Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 984b0ee3 authored by Mark Rustad's avatar Mark Rustad Committed by Jeff Kirsher
Browse files

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: default avatarMark Rustad <mark.d.rustad@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent dbf8b0d8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)