aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAkeem G. Abodunrin <akeem.g.abodunrin@intel.com>2013-05-01 22:57:44 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-05-21 05:19:03 -0400
commit6c1d8b96d09ed8852f5bc11c42374be3232374ce (patch)
treef9ebfcd1f4055f791992321a68fddc474ddfe96f /drivers/net
parent603cdca9805e4f8001cf7ffbd8c539c9fa6674ce (diff)
e1000e: Release mutex lock only if it has been initially acquired
This patch fixes the issue of unlocking swflag_mutex for 82574 and 82583 devices regardless of if the hw semaphore has been successfully acquired via e1000_get_hw_semaphore_82574(). With this patch, unlocking mutex now depends on if the hw semaphore was successfully acquired before. And 82574/82583 devices are reset regardless of whether e1000_get_hw_semaphore_82574() returns success or failure. Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/e1000e/82571.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index bef2f103ab03..4c303e2a7cb3 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1003,8 +1003,6 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
1003 default: 1003 default:
1004 break; 1004 break;
1005 } 1005 }
1006 if (ret_val)
1007 e_dbg("Cannot acquire MDIO ownership\n");
1008 1006
1009 ctrl = er32(CTRL); 1007 ctrl = er32(CTRL);
1010 1008
@@ -1015,7 +1013,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
1015 switch (hw->mac.type) { 1013 switch (hw->mac.type) {
1016 case e1000_82574: 1014 case e1000_82574:
1017 case e1000_82583: 1015 case e1000_82583:
1018 e1000_put_hw_semaphore_82574(hw); 1016 /* Release mutex only if the hw semaphore is acquired */
1017 if (!ret_val)
1018 e1000_put_hw_semaphore_82574(hw);
1019 break; 1019 break;
1020 default: 1020 default:
1021 break; 1021 break;