Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d2a900365b8963d7ca46f05d8e7176d1be3cc71d
Commit:     d2a900365b8963d7ca46f05d8e7176d1be3cc71d
Parent:     069f8256362b7a17da532f0631cee73b4cfee65b
Author:     [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 19:49:15 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Thu Mar 15 10:59:54 2007 -0400

    natsemi: Avoid IntrStatus lossage if RX state machine resets.
    
    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 <[EMAIL PROTECTED]>
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/natsemi.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 5f88200..349b96a 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2169,6 +2169,14 @@ static int natsemi_poll(struct net_device *dev, int 
*budget)
                               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 @@ static int natsemi_poll(struct net_device *dev, int 
*budget)
                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;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to