Skip to contentSkip to conversation

PATCH for [Bug 8952] tulip driver oops in tulip_interrupt when hibernating with swsusp/suspend2

PATCH Applied Grant Grundler 2 participants 4 messages May 12, 2008 – May 31, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Jeff,
The following patch is seems to fix the tulip suspend/resume panic:

	http://bugzilla.kernel.org/show_bug.cgi?id=8952#c46

My attempts at a cleaner patch failed and Pavel thinks this is OK. Since suspend/resume is getting an overhaul in 2.6.27 (per comment #49 by Rafael J. Wysocki), it makes sense to invest more time as part of that rework and apply the known fix to 2.6.26.

hth,
grant

Original from: [email protected]

drivers/net/tulip/tulip_core.c +8 -2
index f9d13fa..088d3bf 100644
@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state)
 	if (!dev)
 		return -EINVAL;
 
-	if (netif_running(dev))
-		tulip_down(dev);
+	if (!netif_running(dev))
+		goto save_state:
+
+	tulip_down(dev);
 
 	netif_device_detach(dev);
 	free_irq(dev->irq, dev);
 
+save_state:
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
 	pci_set_power_state(pdev, pci_choose_state(pdev, state));
@@ -1754,6 +1757,9 @@ static int tulip_resume(struct pci_dev *pdev)
 	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
 
+	if (!netif_running(dev))
+		return 0;
+
 	if ((retval = pci_enable_device(pdev))) {
 		printk (KERN_ERR "tulip: pci_enable_device failed in resume\n");
 		return retval;
#1 lore raw
Quoted 20 lines · Grant Grundler

Jeff,
The following patch is seems to fix the tulip suspend/resume panic:

	http://bugzilla.kernel.org/show_bug.cgi?id=8952#c46

My attempts at a cleaner patch failed and Pavel thinks this is OK. Since suspend/resume is getting an overhaul in 2.6.27 (per comment #49 by Rafael J. Wysocki), it makes sense to invest more time as part of that rework and apply the known fix to 2.6.26.

hth,
grant

Original from: [email protected]

drivers/net/tulip/tulip_core.c +0 -0
index f9d13fa..088d3bf 100644

drivers/net/tulip/tulip_core.c static int tulip_suspend (struct pci_dev *pdev, pm_message_t state) · line 1735

Quoted 9 lines
drivers/net/tulip/tulip_core.c +4 -2
@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state)
 	if (!dev)
 		return -EINVAL;
 
-	if (netif_running(dev))
-		tulip_down(dev);
+	if (!netif_running(dev))
+		goto save_state:
+
+	tulip_down(dev);

how could this be tested if it doesn't even compile?

Oh well, seems sane, let's see...

#2 lore raw
Quoted 22 lines · Jeff Garzik
Quoted 21 lines · Grant Grundler

Jeff,
The following patch is seems to fix the tulip suspend/resume panic:

	http://bugzilla.kernel.org/show_bug.cgi?id=8952#c46

My attempts at a cleaner patch failed and Pavel thinks this is OK. Since suspend/resume is getting an overhaul in 2.6.27 (per comment #49 by Rafael J. Wysocki), it makes sense to invest more time as part of that rework and apply the known fix to 2.6.26. hth,
grant
Original from: [email protected]

drivers/net/tulip/tulip_core.c +0 -0
index f9d13fa..088d3bf 100644
@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, 
 pm_message_t state)
 	if (!dev)
 		return -EINVAL;
 -	if (netif_running(dev))
Quoted 8 lines

drivers/net/tulip/tulip_core.c static int tulip_suspend (struct pci_dev *pdev, pm_message_t state) · line 1735

Quoted 5 lines
drivers/net/tulip/tulip_core.c +4 -1
-		tulip_down(dev);
+	if (!netif_running(dev))
+		goto save_state:
+
+	tulip_down(dev);

how could this be tested if it doesn't even compile? Oh well, seems sane, let's see...

Thanks for fixing up the : vs ; and applying.
Is there a canonical description of what suspend/resume has to do?

As noted in the bug report, the NIC drivers are very inconsistent in what they do in these routines.

thanks,
grant

Applied
#3 lore raw
In reply to Grant Grundler

drivers/net/tulip/tulip_core.c

Quoted 16 lines · Grant Grundler

Jeff,
The following patch is seems to fix the tulip suspend/resume panic:

	http://bugzilla.kernel.org/show_bug.cgi?id=8952#c46

My attempts at a cleaner patch failed and Pavel thinks this is OK. Since suspend/resume is getting an overhaul in 2.6.27 (per comment #49 by Rafael J. Wysocki), it makes sense to invest more time as part of that rework and apply the known fix to 2.6.26.

hth,
grant

Original from: [email protected]

drivers/net/tulip/tulip_core.c +0 -0

applied