netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] forcedeth: napi schedule lock fix
@ 2009-01-09 21:03 Ayaz Abdulla
  2009-01-10  7:13 ` David Miller
  2009-01-27 16:28 ` Vitaliy Gusev
  0 siblings, 2 replies; 3+ messages in thread
From: Ayaz Abdulla @ 2009-01-09 21:03 UTC (permalink / raw)
  To: Manfred Spraul, Jeff Garzik, Andrew Morton, nedev

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

This patch fixes a potential race condition between scheduling napi and 
completing napi poll. The call to netif_rx_schedule should be under 
protection of the lock (as is the completion), otherwise, interrupts 
could be masked off.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>


[-- Attachment #2: patch-forcedeth-napi-lock --]
[-- Type: text/plain, Size: 750 bytes --]

--- old/drivers/net/forcedeth.c	2009-01-09 15:11:55.000000000 -0800
+++ new/drivers/net/forcedeth.c	2009-01-09 15:17:27.000000000 -0800
@@ -3407,10 +3407,10 @@
 
 #ifdef CONFIG_FORCEDETH_NAPI
 		if (events & NVREG_IRQ_RX_ALL) {
+			spin_lock(&np->lock);
 			netif_rx_schedule(dev, &np->napi);
 
 			/* Disable furthur receive irq's */
-			spin_lock(&np->lock);
 			np->irqmask &= ~NVREG_IRQ_RX_ALL;
 
 			if (np->msi_flags & NV_MSI_X_ENABLED)
@@ -3524,10 +3524,10 @@
 
 #ifdef CONFIG_FORCEDETH_NAPI
 		if (events & NVREG_IRQ_RX_ALL) {
+			spin_lock(&np->lock);
 			netif_rx_schedule(dev, &np->napi);
 
 			/* Disable furthur receive irq's */
-			spin_lock(&np->lock);
 			np->irqmask &= ~NVREG_IRQ_RX_ALL;
 
 			if (np->msi_flags & NV_MSI_X_ENABLED)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-27 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09 21:03 [PATCH 3/4] forcedeth: napi schedule lock fix Ayaz Abdulla
2009-01-10  7:13 ` David Miller
2009-01-27 16:28 ` Vitaliy Gusev

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).