Commit 56997fa8 authored by Grant Grundler's avatar Grant Grundler Committed by Jeff Garzik

[netdrvr] tulip: oops in tulip_interrupt when hibernating with swsusp/suspend2

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.

Original from:  kernelbugs@tap.homeip.net
Signed-off-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent aefdbf1a
...@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -1729,12 +1729,15 @@ static int tulip_suspend (struct pci_dev *pdev, pm_message_t state)
if (!dev) if (!dev)
return -EINVAL; return -EINVAL;
if (netif_running(dev)) if (!netif_running(dev))
goto save_state;
tulip_down(dev); tulip_down(dev);
netif_device_detach(dev); netif_device_detach(dev);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
save_state:
pci_save_state(pdev); pci_save_state(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state)); pci_set_power_state(pdev, pci_choose_state(pdev, state));
...@@ -1754,6 +1757,9 @@ static int tulip_resume(struct pci_dev *pdev) ...@@ -1754,6 +1757,9 @@ static int tulip_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev); pci_restore_state(pdev);
if (!netif_running(dev))
return 0;
if ((retval = pci_enable_device(pdev))) { if ((retval = pci_enable_device(pdev))) {
printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); printk (KERN_ERR "tulip: pci_enable_device failed in resume\n");
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment