Skip to content

Commit

Permalink
natsemi: Avoid IntrStatus lossage if RX state machine resets.
Browse files Browse the repository at this point in the history
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>

Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
broonie authored and Jeff Garzik committed Mar 15, 2007
1 parent 069f825 commit d2a9003
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/net/natsemi.c
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit d2a9003

Please sign in to comment.