From: Emil Tantilov Date: Wed, 29 May 2013 06:23:05 +0000 (+0000) Subject: ixgbe: fix semaphore lock for I2C read/writes on 82598 X-Git-Tag: v3.12-rc1~132^2~416^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dcc2f4142610cc7212a757348d45f1e815927c9;p=pandora-kernel.git ixgbe: fix semaphore lock for I2C read/writes on 82598 ixgbe_read/write_i2c_phy_82598() does not hold the SWFW_SYNC semaphore for the entire function. Instead the lock is held only during the phy.ops.read/write_reg operations. As result when the function is being called simultaneously the I2C read/writes can be corrupted. The following patch introduces the SWFW_SYNC semaphore for the entire ixgbe_read/write_i2c_phy_82598() function. To accomplish this I had to create 2 separate functions: ixgbe_read_phy_reg_mdi() ixgbe_write_phy_reg_mdi() Those functions are identical to ixgbe_read/write_phy_reg_generic() sans the locking, and can be used in ixgbe_read/write_i2c_phy_82598() with the SWFW_SYNC semaphore being held. Signed-off-by: Emil Tantilov Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- Reading git-diff-tree failed