Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Dillow
Date: Monday, August 24, 2009 - 7:59 pm

On Mon, 2009-08-24 at 17:51 -0700, Eric W. Biederman wrote:

Maybe not when only those bits are set, but I worry that we would trade
one race for another where we stop getting interrupts from the card.


Then you'd never get an interrupt for them in the first place, I think.

I'm not real happy with the interrupt handling in the driver; it makes a
certain amount of sense to split the MSI vs non-MSI interrupt cases out.
It also means another pass through re-auditing things against the vendor
driver. That's more work than I'm able to commit to at the moment.

I've not been able to reproduce it locally on my r8169d, running for ~30
minutes straight at full speed. I've not tried running it in UP, though.
Perhaps I can do that tomorrow.

Here's a possible patch to mask the NAPI events while we're running in
NAPI mode. I'm not sure it is going to help, since the intr_mask was
0xffff when you hit the loop guard, so I left it in for now.

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b82780d..12755b7 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3556,6 +3556,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 	void __iomem *ioaddr = tp->mmio_addr;
 	int handled = 0;
 	int status;
+	int count = 0;
 
 	/* loop handling interrupts until we have no new ones or
 	 * we hit a invalid/hotplug case.
@@ -3564,6 +3565,15 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 	while (status && status != 0xffff) {
 		handled = 1;
 
+		if (count++ > 100) {
+			printk_once("r8169 screaming irq status %08x "
+				"mask %08x event %08x napi %08x\n",
+				status, tp->intr_mask, tp->intr_event,
+				tp->napi_event);
+			break;
+		}
+
+
 		/* Handle all of the error cases first. These will reset
 		 * the chip, so just exit the loop.
 		 */
@@ -3613,6 +3623,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 		RTL_W16(IntrStatus,
 			(status & RxFIFOOver) ? (status | RxOverflow) : status);
 		status = RTL_R16(IntrStatus);
+		status &= tp->intr_mask;
 	}
 
 	return IRQ_RETVAL(handled);


--
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 2.6.30-rc4] r8169: avoid losing MSI interrupts, David Dillow, (Fri May 22, 6:29 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Sat May 23, 2:24 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Sat May 23, 7:35 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Sat May 23, 7:44 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Sat May 23, 8:01 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Sat May 23, 9:12 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Sat May 23, 9:40 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Sat May 23, 9:45 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Sat May 23, 9:50 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Sat May 23, 9:53 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, David Dillow, (Sat May 23, 10:03 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Francois Romieu, (Sun May 24, 2:15 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, David Miller, (Mon May 25, 10:55 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Tue May 26, 11:22 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Tue May 26, 3:40 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Buesch, (Wed May 27, 9:19 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Fri Aug 21, 1:57 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michael Riepe, (Fri Aug 21, 2:22 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Fri Aug 21, 5:24 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Sat Aug 22, 4:48 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Sat Aug 22, 5:07 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Jarek Poplawski, (Sun Aug 23, 10:17 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Michal Soltys, (Sun Aug 23, 10:43 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Jarek Poplawski, (Sun Aug 23, 10:54 am)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Sun Aug 23, 7:37 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Mon Aug 24, 5:51 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, David Dillow, (Mon Aug 24, 7:59 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Tue Aug 25, 1:22 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Tue Aug 25, 2:24 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Tue Aug 25, 2:37 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Francois Romieu, (Tue Aug 25, 3:19 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Francois Romieu, (Tue Aug 25, 4:11 pm)
Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts, Eric W. Biederman, (Tue Aug 25, 8:47 pm)
[PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Wed Aug 26, 12:58 am)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Wed Aug 26, 1:02 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Francois Romieu, (Wed Aug 26, 2:30 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Wed Aug 26, 2:40 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Francois Romieu, (Wed Aug 26, 10:24 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Wed Aug 26, 10:38 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Francois Romieu, (Thu Aug 27, 4:20 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Thu Aug 27, 6:17 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Francois Romieu, (Sun Aug 30, 1:37 pm)
Re: [PATCH] r8169: Reduce looping in the interrupt handler., Eric W. Biederman, (Sun Aug 30, 1:53 pm)