netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: Realtek 8139 driver (8139too.c) TX Timeout doesn't allow interrupt handler to disable receive interrupts at high bi-directional traffic
@ 2006-11-29  8:50 Basheer, Mansoor Ahamed
  2006-11-29 20:24 ` Stephen Hemminger
  0 siblings, 1 reply; 10+ messages in thread
From: Basheer, Mansoor Ahamed @ 2006-11-29  8:50 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev

Francois Romieu [mailto:romieu@fr.zoreil.com] wrote:

> Afaics your change may disable the Rx irq right after the poll routine

> enabled it again. It will not always work either.
> 
> The (slow) timeout watchdog could grab the poll handler and hack the 
> irq mask depending on whether poll was scheduled or not.

Could you please confirm whether the attached patch would work?
I tested it and it works for me.


Signed-off-by: Mansoor Ahamed <mansoor.ahamed@ti.com>

--- old/8139too.c	2006-11-14 10:44:27.000000000 +0530
+++ new/8139too.c	2006-11-14 10:44:18.000000000 +0530
@@ -1438,8 +1438,18 @@
 	if ((!(tmp & CmdRxEnb)) || (!(tmp & CmdTxEnb)))
 		RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
 
-	/* Enable all known interrupts by setting the interrupt mask. */
-	RTL_W16 (IntrMask, rtl8139_intr_mask);
+	local_irq_disable();
+	/* Don't enable RX if RX was already scheduled */
+	if(test_bit(__LINK_STATE_START, &dev->state) &&
+			test_bit(__LINK_STATE_RX_SCHED, &dev->state) ) {
+		/* Enable all interrupts except RX by setting the
interrupt mask. */
+		RTL_W16 (IntrMask, rtl8139_norx_intr_mask);
+	}
+	else {
+		/* Enable all known interrupts by setting the interrupt
mask. */ 
+		RTL_W16 (IntrMask, rtl8139_intr_mask);
+	}
+	local_irq_enable();
 }

Thanks
Mansoor

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Realtek 8139 driver (8139too.c) TX Timeout doesn't allow interrupt handler to disable receive interrupts at high bi-directional traffic
@ 2006-11-09 14:22 Basheer, Mansoor Ahamed
  2006-11-09 23:46 ` Francois Romieu
  0 siblings, 1 reply; 10+ messages in thread
From: Basheer, Mansoor Ahamed @ 2006-11-09 14:22 UTC (permalink / raw)
  To: netdev

Hi All

I found an issue with Realtek 8139 driver (2.6.10 branch) at high
bi-directional traffic. On transmit timeout, driver's timeout callback
re-enables the receive interrupt. On the next receive interrupt, the ISR
disables the receive interrupt "only" when the receive poll task is not
active. But the poll task is actually active and hence it doesn't
disable the receive interrupt. So the ISR returns without clearing the
receive interrupt. This un-serviced receive interrupt brings the system
into hung state.

My understanding here is, on receive interrupt the ISR should disable
the receive interrupt irrespective of the polling task's state (active
or inactive). I changed the code (as shown below) and it works
perfectly. 

Is this a known issue? If so, is there a fix already available?

Also, we get frequent TX timeouts during high rate of traffic. What
could be the reason for this frequent TX timeouts?
 

--- old/8139too.c	2006-11-09 11:49:25.000000000 +0530
+++ new/8139too.c	2006-11-09 11:50:02.000000000 +0530
@@ -2200,8 +2200,8 @@
 	/* Receive packets are processed by poll routine.
 	   If not running start it now. */
 	if (status & RxAckBits){
-		if (netif_rx_schedule_prep(dev)) {
 			RTL_W16_F (IntrMask, rtl8139_norx_intr_mask);
+		if (netif_rx_schedule_prep(dev)) {
 			__netif_rx_schedule (dev);
 		}
 	}


Thanks
Mansoor

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

end of thread, other threads:[~2006-11-30  0:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29  8:50 Realtek 8139 driver (8139too.c) TX Timeout doesn't allow interrupt handler to disable receive interrupts at high bi-directional traffic Basheer, Mansoor Ahamed
2006-11-29 20:24 ` Stephen Hemminger
2006-11-29 22:44   ` Francois Romieu
2006-11-29 22:50     ` Stephen Hemminger
2006-11-29 23:32       ` Francois Romieu
2006-11-30  0:09         ` Stephen Hemminger
2006-11-30  0:25           ` Francois Romieu
  -- strict thread matches above, loose matches on Subject: below --
2006-11-09 14:22 Basheer, Mansoor Ahamed
2006-11-09 23:46 ` Francois Romieu
2006-11-14  5:33   ` Basheer, Mansoor Ahamed

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