提交 984b0ee3 编写于 作者: M Mark Rustad 提交者: Jeff Kirsher

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: NMark Rustad <mark.d.rustad@intel.com>
Tested-by: NPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 dbf8b0d8
...@@ -178,7 +178,11 @@ struct ixgbevf_info { ...@@ -178,7 +178,11 @@ struct ixgbevf_info {
static inline void ixgbe_write_reg(struct ixgbe_hw *hw, u32 reg, u32 value) 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) #define IXGBE_WRITE_REG(h, r, v) ixgbe_write_reg(h, r, v)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册