From: broonie@sirena.org.uk
To: Jeff Garzik <jeff@garzik.org>, Tim Hockin <thockin@hockin.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [patch 3/3] natsemi: Avoid IntrStatus lossage if RX state machine resets.
Date: Wed, 14 Mar 2007 19:49:15 +0000 [thread overview]
Message-ID: <20070314195158.073574000@sirena.org.uk> (raw)
In-Reply-To: 20070314194912.414925000@sirena.org.uk
[-- Attachment #1: natsemi-fix-poll-ordering --]
[-- Type: text/plain, Size: 1385 bytes --]
This patch fixes the poll routine for the natsemi driver so that if the
driver detects an RX state machine lockup then no interrupts will be
lost while the driver recovers from that.
Signed-Off-By: Mark Brown <broonie@sirena.org.uk>
Index: linux-2.6/drivers/net/natsemi.c
===================================================================
--- linux-2.6.orig/drivers/net/natsemi.c 2007-03-13 19:38:31.000000000 +0000
+++ linux-2.6/drivers/net/natsemi.c 2007-03-13 19:39:08.000000000 +0000
@@ -2169,6 +2169,14 @@
dev->name, np->intr_status,
readl(ioaddr + IntrMask));
+ /* netdev_rx() may read IntrStatus again if the RX state
+ * machine falls over so do it first. */
+ if (np->intr_status &
+ (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
+ IntrRxErr | IntrRxOverrun)) {
+ netdev_rx(dev, &work_done, work_to_do);
+ }
+
if (np->intr_status &
(IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) {
spin_lock(&np->lock);
@@ -2180,12 +2188,6 @@
if (np->intr_status & IntrAbnormalSummary)
netdev_error(dev, np->intr_status);
- if (np->intr_status &
- (IntrRxDone | IntrRxIntr | RxStatusFIFOOver |
- IntrRxErr | IntrRxOverrun)) {
- netdev_rx(dev, &work_done, work_to_do);
- }
-
*budget -= work_done;
dev->quota -= work_done;
--
"You grabbed my hand and we fell into it, like a daydream - or a fever."
prev parent reply other threads:[~2007-03-14 19:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-14 19:49 [patch 0/3] natsemi updates broonie
2007-03-14 19:49 ` [patch 1/3] natsemi: Consistently use interrupt enable/disable functions broonie
2007-03-15 15:00 ` Jeff Garzik
2007-03-14 19:49 ` [patch 2/3] natsemi: Fix NAPI for interrupt sharing broonie
2007-03-14 19:49 ` broonie [this message]
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=20070314195158.073574000@sirena.org.uk \
--to=broonie@sirena.org.uk \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thockin@hockin.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).