Re: e1000e NVM corruption issue status

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Brandeburg, Jesse <jesse.brandeburg@...>
Cc: LKML <linux-kernel@...>, Jiri Kosina <jkosina@...>, <agospoda@...>, Ronciak, John <john.ronciak@...>, Allan, Bruce W <bruce.w.allan@...>, Graham, David <david.graham@...>, <kkiel@...>, <tglx@...>, <chris.jones@...>, <arjan@...>
Date: Thursday, September 25, 2008 - 10:11 pm

e1000e: debug contention on NVM SWFLAG

From: Thomas Gleixner

This patch adds a mutex to the e1000e driver that would help
catch any collisions of two e1000e threads accessing hardware
at the same time.

description and patch updated by Jesse

Signed-off-by: Thomas Gleixner
Signed-off-by: Jesse Brandeburg
---

drivers/net/e1000e/ich8lan.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index f1a6e55..2b1aa2a 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -382,6 +382,9 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
return 0;
}

+static DEFINE_MUTEX(nvm_mutex);
+static pid_t nvm_owner = -1;
+
/**
* e1000_acquire_swflag_ich8lan - Acquire software control flag
* @hw: pointer to the HW structure
@@ -395,6 +398,15 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
u32 extcnf_ctrl;
u32 timeout = PHY_CFG_TIMEOUT;

+ WARN_ON(preempt_count());
+
+ if (!mutex_trylock(&nvm_mutex)) {
+ WARN(1, KERN_ERR "e1000e mutex contention. Owned by pid %d\n",
+ nvm_owner);
+ mutex_lock(&nvm_mutex);
+ }
+ nvm_owner = current->pid;
+
while (timeout) {
extcnf_ctrl = er32(EXTCNF_CTRL);
extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG;
@@ -409,6 +421,8 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)

if (!timeout) {
hw_dbg(hw, "FW or HW has locked the resource for too long.\n");
+ nvm_owner = -1;
+ mutex_unlock(&nvm_mutex);
return -E1000_ERR_CONFIG;
}

@@ -430,6 +444,9 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw)
extcnf_ctrl = er32(EXTCNF_CTRL);
extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG;
ew32(EXTCNF_CTRL, extcnf_ctrl);
+
+ nvm_owner = -1;
+ mutex_unlock(&nvm_mutex);
}

/**
--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 9:50 pm)
Re: e1000e NVM corruption issue status, James Courtier-Dutton, (Sat Oct 18, 3:13 pm)
Re: e1000e NVM corruption issue status, Jiri Kosina, (Sat Oct 18, 6:49 pm)
Re: e1000e NVM corruption issue status, Karsten Keil, (Fri Sep 26, 3:19 am)
Re: e1000e NVM corruption issue status, Jesse Brandeburg, (Fri Sep 26, 1:44 am)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:01 pm)
Re: e1000e NVM corruption issue status, Karsten Keil, (Fri Sep 26, 10:23 am)
Re: e1000e NVM corruption issue status, Jiri Kosina, (Fri Sep 26, 2:13 am)
Re: e1000e NVM corruption issue status, Arjan van de Ven, (Fri Sep 26, 7:49 am)
Re: e1000e NVM corruption issue status, Jesse Barnes, (Fri Sep 26, 1:52 pm)
Re: e1000e NVM corruption issue status, Jesse Barnes, (Fri Sep 26, 2:23 pm)
Re: e1000e NVM corruption issue status, Tim Gardner, (Fri Sep 26, 2:53 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Fri Sep 26, 8:05 pm)
Re: e1000e NVM corruption issue status, Tim Gardner, (Sat Sep 27, 12:20 am)
Re: e1000e NVM corruption issue status, Krzysztof Halasa, (Fri Sep 26, 6:04 pm)
RE: e1000e NVM corruption issue status, Brandeburg, Jesse, (Fri Sep 26, 6:23 pm)
Re: e1000e NVM corruption issue status, Krzysztof Halasa, (Sat Sep 27, 2:45 pm)
Re: e1000e NVM corruption issue status, Jesse Barnes, (Fri Sep 26, 2:39 pm)
Re: e1000e NVM corruption issue status, Jesse Barnes, (Fri Sep 26, 2:43 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:13 pm)
Re: e1000e NVM corruption issue status, Jiri Kosina, (Mon Sep 29, 11:52 am)
Re: e1000e NVM corruption issue status, Jiri Kosina, (Mon Sep 29, 12:20 pm)
RE: e1000e NVM corruption issue status, Brandeburg, Jesse, (Mon Sep 29, 12:24 pm)
RE: e1000e NVM corruption issue status, Jiri Kosina, (Mon Sep 29, 1:18 pm)
RE: e1000e NVM corruption issue status, Jiri Kosina, (Mon Sep 29, 1:36 pm)
RE: e1000e NVM corruption issue status, Jiri Kosina, (Mon Sep 29, 6:43 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:13 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:12 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:12 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:11 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:11 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:10 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:10 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:10 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:09 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:09 pm)
Re: e1000e NVM corruption issue status, Ingo Molnar, (Fri Sep 26, 3:12 am)
Re: e1000e NVM corruption issue status, Chris Snook, (Thu Sep 25, 9:58 pm)
Re: e1000e NVM corruption issue status, Brandeburg, Jesse, (Thu Sep 25, 10:04 pm)