Subject: [PATCH 4/3] forcedeth: fix NAPI hang in IRQ.

From: Stephen Hemminger <[email-masked]>
Date: Thu, 27 Jul 2006 19:01:14 -0700

Fix for NAPI hanging in interrupt. With NAPI, we only need one
iteration over the IRQ.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- linux-2.6.orig/drivers/net/forcedeth.c	2006-07-27
18:58:21.000000000 -0700 +++ linux-2.6/drivers/net/forcedeth.c
2006-07-27 18:57:31.000000000 -0700 @@ -2422,10 +2422,11 @@
 						dev->name, events);
 		}
 #ifdef CONFIG_FORCEDETH_NAPI
-		if (netif_rx_schedule_prep(dev)) {
-			__netif_rx_schedule(dev);
+		if (events & NVREG_IRQ_RX_ALL) {
+			netif_rx_schedule(dev);
 			nv_disable_hw_interrupts(dev,
NVREG_IRQ_RX_ALL); }
+		return IRQ_HANDLED;
 #else
 		nv_rx_process(dev, dev->weight);
 		if (nv_alloc_rx(dev)) {
@@ -2434,7 +2435,6 @@
 				mod_timer(&np->oom_kick, jiffies +
OOM_REFILL); spin_unlock(&np->lock);
 		}
-#endif
 		if (i > max_interrupt_work) {
 			spin_lock(&np->lock);
 			/* disable interrupts on the nic */
@@ -2452,7 +2452,7 @@
 			spin_unlock(&np->lock);
 			break;
 		}
-
+#endif
 	}
 	dprintk(KERN_DEBUG "%s: nv_nic_irq completed\n", dev->name);