From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Emil Tantilov <emil.s.tantilov@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 04/13] ixgbe: force unlock on timeout
Date: Sat, 14 May 2011 18:23:38 -0700 [thread overview]
Message-ID: <1305422627-9583-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1305422627-9583-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Emil Tantilov <emil.s.tantilov@intel.com>
The semaphore can be in locked state upon driver load, particularly
on 82598 if a machine is rebooted due to panic and the semaphore was
acquired just prior to the panic.
This patch unlocks the semaphore if it times out.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_common.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index c4730cd..b894b42 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1189,6 +1189,28 @@ static s32 ixgbe_get_eeprom_semaphore(struct ixgbe_hw *hw)
udelay(50);
}
+ if (i == timeout) {
+ hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore "
+ "not granted.\n");
+ /*
+ * this release is particularly important because our attempts
+ * above to get the semaphore may have succeeded, and if there
+ * was a timeout, we should unconditionally clear the semaphore
+ * bits to free the driver to make progress
+ */
+ ixgbe_release_eeprom_semaphore(hw);
+
+ udelay(50);
+ /*
+ * one last try
+ * If the SMBI bit is 0 when we read it, then the bit will be
+ * set and we have the semaphore
+ */
+ swsm = IXGBE_READ_REG(hw, IXGBE_SWSM);
+ if (!(swsm & IXGBE_SWSM_SMBI))
+ status = 0;
+ }
+
/* Now get the semaphore between SW/FW through the SWESMBI bit */
if (status == 0) {
for (i = 0; i < timeout; i++) {
--
1.7.4.4
next prev parent reply other threads:[~2011-05-15 1:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-15 1:23 [net-next-2.6 00/13][pull request] Intel Wired LAN Driver Update Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 01/13] e1000e: minor comment cleanups Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 02/13] ixgbevf: Add macvlan support in the set rx mode op Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 03/13] ixgbe: Add macvlan support for VF Jeff Kirsher
2011-05-15 1:23 ` Jeff Kirsher [this message]
2011-05-15 1:23 ` [net-next-2.6 05/13] ixgbe: move flags and state into the same cacheline Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 06/13] ixgbe: Combine SFP and multi-speed fiber task into single service task Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 07/13] ixgbe: Merge watchdog functionality into " Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 08/13] ixgbe: merge reset task " Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 09/13] ixgbe: Merge ATR reinit into the " Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 10/13] ixgbe: Merge over-temp task into " Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 11/13] ixgbe: cleanup some minor issues in ixgbe_down() Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 12/13] ixgbe: fix sparse warning Jeff Kirsher
2011-05-15 1:23 ` [net-next-2.6 13/13] ixgbe: Add support for new 82599 adapter Jeff Kirsher
2011-05-15 5:21 ` [net-next-2.6 00/13][pull request] Intel Wired LAN Driver Update David Miller
2011-05-15 8:41 ` Jeff Kirsher
2011-05-15 19:46 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305422627-9583-5-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=bphilips@novell.com \
--cc=davem@davemloft.net \
--cc=emil.s.tantilov@intel.com \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).