ixgbe: fix possible data corruption in read_i2c_byte
This patch makes sure that the SW lock is released after all i2c operations complete in the retry code path. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
4c696ca9fb
commit
d0310dc415
drivers/net/ethernet/intel/ixgbe
|
@ -1307,9 +1307,9 @@ s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
ixgbe_i2c_bus_clear(hw);
|
||||||
hw->mac.ops.release_swfw_sync(hw, swfw_mask);
|
hw->mac.ops.release_swfw_sync(hw, swfw_mask);
|
||||||
msleep(100);
|
msleep(100);
|
||||||
ixgbe_i2c_bus_clear(hw);
|
|
||||||
retry++;
|
retry++;
|
||||||
if (retry < max_retry)
|
if (retry < max_retry)
|
||||||
hw_dbg(hw, "I2C byte read error - Retrying.\n");
|
hw_dbg(hw, "I2C byte read error - Retrying.\n");
|
||||||
|
|
Loading…
Reference in New Issue