PATCH for [Bug 8952] tulip driver oops in tulip_interrupt when hibernating with swsusp/suspend2
Subsystems (2)
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
@@ -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;
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#c46My 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,
grantOriginal from: [email protected]
Signed-off-by Grant Grundler <[email protected]>drivers/net/tulip/tulip_core.c +0
-0
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...
Jeff Garzik
Applieddrivers/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#c46My 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,
grantOriginal from: [email protected]
Signed-off-by Grant Grundler <[email protected]>drivers/net/tulip/tulip_core.c +0
-0
applied
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#c46My 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]Signed-off-by Grant Grundler <[email protected]>drivers/net/tulip/tulip_core.c +0
-0@@ -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