From: Bruce Allan Date: Fri, 13 May 2011 07:19:53 +0000 (+0000) Subject: e1000e: log when swflag is cleared unexpectedly on ICH/PCH devices X-Git-Tag: v2.6.39-400.9.0~619^2~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aef8a593655be6084d203987a989c4f7f4018433;p=users%2Fjedix%2Flinux-maple.git e1000e: log when swflag is cleared unexpectedly on ICH/PCH devices Since EXTCNF_CTRL.SWFLAG (used in the ownership arbitration of shared resources, e.g. the PHY shared between the s/w, f/w, and h/w clients) can be cleared by any of those clients, log a debug message when software attempts to clear it and it is already cleared unexpectedly. And since the swflag is cleared by a hardware reset, the driver does not need to do that, but the mutex acquired when the bit is set must still be cleared. Signed-off-by: Bruce Allan Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher (cherry picked from commit c5caf4825b22957e4ad70fd94316e91ce8cfb51c) Signed-off-by: Joe Jin --- diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index d7693a48eeb0..2f7121cc697d 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c @@ -890,8 +890,13 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) u32 extcnf_ctrl; extcnf_ctrl = er32(EXTCNF_CTRL); - extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; - ew32(EXTCNF_CTRL, extcnf_ctrl); + + if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG) { + extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; + ew32(EXTCNF_CTRL, extcnf_ctrl); + } else { + e_dbg("Semaphore unexpectedly released by sw/fw/hw\n"); + } mutex_unlock(&swflag_mutex); } @@ -3075,7 +3080,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) msleep(20); if (!ret_val) - e1000_release_swflag_ich8lan(hw); + mutex_unlock(&swflag_mutex); if (ctrl & E1000_CTRL_PHY_RST) { ret_val = hw->phy.ops.get_cfg_done(hw);