Re: [GIT]: Networking

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: David Miller <davem@...>, <torvalds@...>, <akpm@...>, <netdev@...>, <linux-kernel@...>, Ayaz Abdulla <aabdulla@...>
Date: Thursday, July 2, 2009 - 10:04 am

Eric Dumazet a écrit :

Oh well this patch was soooo stupid, sorry Ingo.


We might have a race in napi_schedule(), leaving interrupts disabled forever.
I cannot test this patch, I dont have the hardware...

Thanks

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 1094d29..3b4e076 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3514,11 +3514,13 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
 	nv_msi_workaround(np);
 
 #ifdef CONFIG_FORCEDETH_NAPI
-	napi_schedule(&np->napi);
-
-	/* Disable furthur irq's
-	   (msix not enabled with napi) */
-	writel(0, base + NvRegIrqMask);
+	if (napi_schedule_prep(&np->napi)) {
+		/*
+		 * Disable further irq's (msix not enabled with napi)
+		 */
+		writel(0, base + NvRegIrqMask);
+		__napi_schedule(&np->napi);
+	}
 
 #else
 	do
@@ -3615,12 +3617,13 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
 	nv_msi_workaround(np);
 
 #ifdef CONFIG_FORCEDETH_NAPI
-	napi_schedule(&np->napi);
-
-	/* Disable furthur irq's
-	   (msix not enabled with napi) */
-	writel(0, base + NvRegIrqMask);
-
+	if (napi_schedule_prep(&np->napi)) {
+		/*
+		 * Disable further irq's (msix not enabled with napi)
+		 */
+		writel(0, base + NvRegIrqMask);
+		__napi_schedule(&np->napi);
+	}
 #else
 	do
 	{
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH net-2.6 6/7] jme: Tuning rxsum function, Guo-Fu Tseng, (Tue Jun 30, 5:14 pm)
[GIT]: Networking, David Miller, (Wed Jul 1, 12:39 am)
Re: [GIT]: Networking, Ingo Molnar, (Thu Jul 2, 3:57 am)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 6:51 am)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 10:04 am)
Re: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 12:13 pm)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 6:32 pm)
Re: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 1:29 pm)
Re: [GIT]: Networking, David Miller, (Thu Jul 2, 9:32 pm)
Re: [GIT]: Networking, Eric Dumazet, (Thu Jul 2, 8:07 pm)
RE: [GIT]: Networking, Ayaz Abdulla, (Thu Jul 2, 9:11 pm)
Re: [GIT]: Networking, David Miller, (Thu Jul 2, 9:30 pm)
Re: [GIT]: Networking, Ingo Molnar, (Thu Jul 2, 4:05 pm)
Re: [GIT]: Networking, Ingo Molnar, (Fri Jul 3, 5:46 pm)
Re: [GIT]: Networking, David Miller, (Sun Jul 5, 10:04 pm)
Re: [GIT]: Networking, Herbert Xu, (Sun Jul 5, 12:09 am)