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-Tag: v3.9-rc1~139^2~46^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0310dc415a670ae2b2e27076b4685d988830479;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.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 eb534a0..d7b5bd0 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");