提交 6c1d8b96 编写于 作者: A Akeem G. Abodunrin 提交者: Jeff Kirsher

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: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: NAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 603cdca9
......@@ -1003,8 +1003,6 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
default:
break;
}
if (ret_val)
e_dbg("Cannot acquire MDIO ownership\n");
ctrl = er32(CTRL);
......@@ -1015,7 +1013,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
switch (hw->mac.type) {
case e1000_82574:
case e1000_82583:
e1000_put_hw_semaphore_82574(hw);
/* Release mutex only if the hw semaphore is acquired */
if (!ret_val)
e1000_put_hw_semaphore_82574(hw);
break;
default:
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册