ixgbevf: Check for adapter removal on register writes
authorMark Rustad <mark.d.rustad@intel.com>
Tue, 4 Mar 2014 03:02:40 +0000 (03:02 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 21 Mar 2014 09:28:20 +0000 (02:28 -0700)
Prevent writes to an adapter that has been detected as removed
by a previous failing read.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbevf/vf.h

index 7cb1a52..096d33a 100644 (file)
@@ -178,7 +178,11 @@ struct ixgbevf_info {
 
 static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value)
 {
-       writel(value, hw->hw_addr + reg);
+       u8 __iomem *reg_addr = ACCESS_ONCE(hw->hw_addr);
+
+       if (IXGBE_REMOVED(reg_addr))
+               return;
+       writel(value, reg_addr + reg);
 }
 #define IXGBE_WRITE_REG(h, r, v) ixgbe_write_reg(h, r, v)