From: Emil Tantilov Date: Fri, 18 Jan 2013 02:16:41 +0000 (+0000) Subject: ixgbe: fix possible data corruption in read_i2c_byte X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d0310dc415a670ae2b2e27076b4685d988830479;p=linux-beck.git 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 Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index eb534a071fde..d7b5bd047604 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c @@ -1307,9 +1307,9 @@ s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset, break; fail: + ixgbe_i2c_bus_clear(hw); hw->mac.ops.release_swfw_sync(hw, swfw_mask); msleep(100); - ixgbe_i2c_bus_clear(hw); retry++; if (retry < max_retry) hw_dbg(hw, "I2C byte read error - Retrying.\n");