From: Mark Rustad Date: Tue, 4 Mar 2014 03:02:40 +0000 (+0000) Subject: ixgbevf: Check for adapter removal on register writes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=984b0ee3e3bd1c2d6c955f9121d60bbfd96c399d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ixgbevf: Check for adapter removal on register writes Prevent writes to an adapter that has been detected as removed by a previous failing read. Signed-off-by: Mark Rustad Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h index 7cb1a520e561..096d33a59def 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.h +++ b/drivers/net/ethernet/intel/ixgbevf/vf.h @@ -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)