Skip to contentSkip to conversation

8139too

OOPS Manfred Spraul 3 participants 4 messages Mar 14, 2001 – Mar 23, 2001 Networking

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

Hello LKML!

i686 2.4.2 UP+kdb+lm_sensors+pcmcia
after APM laptop suspend to disk
8139too is build-in, not pcmcia
I often get hangups after suspend-to-disk if I'm connected to a

hub/switch.

Quoted 1 line

This is the first oops I've actually seen and copied it by hand:

I remember a similar bug report.

Was the nic connected or not?
It seems that rtl8139_resume() unconditionally enables the nic, even if it wasn't open()'ed. Then an interrupt arrives and crashes because some memory structures were not allocated.

--

Manfred

#1 lore raw
Quoted 6 lines · Manfred Spraul
Quoted 5 lines

after APM laptop suspend to disk
8139too is build-in, not pcmcia
I often get hangups after suspend-to-disk if I'm connected to a hub/switch.
This is the first oops I've actually seen and copied it by hand:

Was the nic connected or not?

The network was pluged in, but eth0 was not yet ifconfig'ed up.

Quoted 3 lines

It seems that rtl8139_resume() unconditionally enables the nic, even if it wasn't open()'ed. Then an interrupt arrives and crashes because some memory structures were not allocated.

Will take a look myself after my exams.

BYtE
Philipp

Signature · 3 lines
  / /  (_)__  __ ____  __ Philipp Hahn
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ [email protected]
#2 lore raw
Quoted 5 lines

i686 2.4.2 UP+kdb+lm_sensors+pcmcia
after APM laptop suspend to disk
8139too is build-in, not pcmcia
I often get hangups after suspend-to-disk if I'm connected to a hub/switch. This is the first oops I've actually seen and copied it by hand:

Philipp,

Does the attached patch solve the problem?

Modifying the interrupt handler may not be necessary, but it's there just in case. (that's the first chunk of the patch)

Regards,

Jeff

Signature · 3 lines
Jeff Garzik       | May you have warm words on a cold evening,
Building 1024     | a full mooon on a dark night,
MandrakeSoft      | and a smooth road all the way to your door.

Index: drivers/net/8139too.c
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/drivers/net/8139too.c,v retrieving revision 1.1.1.29.10.1

net/8139too.c +9 -2
diff -u -r1.1.1.29.10.1 8139too.c
@@ -2028,10 +2028,12 @@
 			rtl8139_weird_interrupt (dev, tp, ioaddr,
 						 status, link_changed);
 
-		if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver))	/* Rx interrupt */
+		if (netif_running (dev) &&
+		    status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver))	/* Rx interrupt */
 			rtl8139_rx_interrupt (dev, tp, ioaddr);
 
-		if (status & (TxOK | TxErr)) {
+		if (netif_running (dev) &&
+		    status & (TxOK | TxErr)) {
 			spin_lock (&tp->lock);
 			rtl8139_tx_interrupt (dev, tp, ioaddr);
 			spin_unlock (&tp->lock);
@@ -2262,6 +2264,9 @@
 	void *ioaddr = tp->mmio_addr;
 	unsigned long flags;
 
+	if (!netif_running (dev))
+		return;
+
 	netif_device_detach (dev);
 
 	spin_lock_irqsave (&tp->lock, flags);
@@ -2282,6 +2287,8 @@
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
 
+	if (!netif_running (dev))
+		return;
 	netif_device_attach (dev);
 	rtl8139_hw_start (dev);
 }
#3 lore raw
Quoted 1 line · Jeff Garzik

Does the attached patch solve the problem?

I didn't have a crash so far, so until now it look's okay. I would like to say "you fixed it", but that's the problem with bugs: You can prove, there are no bugs.
I will tell you as soon as possible if it should happen again, which I hope wont.

Many thanks for your work.

BYtE
Philipp

Signature · 3 lines
  / /  (_)__  __ ____  __ Philipp Hahn
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ [email protected]