tree 8e5a1045b36849c9568677611e060221f49748ca
parent d7ae79c72d072e3208c18ff2dc402a69229b7b1b
author Rafael J. Wysocki <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:16:22 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:16 -0700

[PATCH] 3c59x PM fixes

This patch adds some missing pci-related calls to the suspend and resume
routines of the 3c59x driver.  It also makes the driver free/request IRQ on
suspend/resume, in accordance with the proposal at:
http://lists.osdl.org/pipermail/linux-pm/2005-May/000955.html

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/net/3c59x.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -973,6 +973,11 @@ static int vortex_suspend (struct pci_de
                        netif_device_detach(dev);
                        vortex_down(dev, 1);
                }
+               pci_save_state(pdev);
+               pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
+               free_irq(dev->irq, dev);
+               pci_disable_device(pdev);
+               pci_set_power_state(pdev, pci_choose_state(pdev, state));
        }
        return 0;
 }
@@ -980,8 +985,19 @@ static int vortex_suspend (struct pci_de
 static int vortex_resume (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
+       struct vortex_private *vp = netdev_priv(dev);
 
-       if (dev && dev->priv) {
+       if (dev && vp) {
+               pci_set_power_state(pdev, PCI_D0);
+               pci_restore_state(pdev);
+               pci_enable_device(pdev);
+               pci_set_master(pdev);
+               if (request_irq(dev->irq, vp->full_bus_master_rx ?
+                               &boomerang_interrupt : &vortex_interrupt, 
SA_SHIRQ, dev->name, dev)) {
+                       printk(KERN_WARNING "%s: Could not reserve IRQ %d\n", 
dev->name, dev->irq);
+                       pci_disable_device(pdev);
+                       return -EBUSY;
+               }
                if (netif_running(dev)) {
                        vortex_up(dev);
                        netif_device_attach(dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to