netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH for [Bug 8952] tulip driver oops in tulip_interrupt when hibernating with swsusp/suspend2
@ 2008-05-12  6:37 Grant Grundler
  2008-05-31  2:09 ` Jeff Garzik
  2008-05-31  2:12 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Grundler @ 2008-05-12  6:37 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev

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:  kernelbugs@tap.homeip.net
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>

diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index f9d13fa..088d3bf 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -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;

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

end of thread, other threads:[~2008-05-31 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12  6:37 PATCH for [Bug 8952] tulip driver oops in tulip_interrupt when hibernating with swsusp/suspend2 Grant Grundler
2008-05-31  2:09 ` Jeff Garzik
2008-05-31 23:54   ` Grant Grundler
2008-05-31  2:12 ` Jeff Garzik

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