]> Pileus Git - ~andy/linux/commitdiff
ixgbe: fix possible data corruption in read_i2c_byte
authorEmil Tantilov <emil.s.tantilov@intel.com>
Fri, 18 Jan 2013 02:16:41 +0000 (02:16 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 16 Feb 2013 07:16:09 +0000 (23:16 -0800)
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>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

index eb534a071fde39ec4c1fff53926794af2c74a262..d7b5bd04760453b7b4b21fed446f51af1e7a437e 100644 (file)
@@ -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");