]> err.no Git - linux-2.6/commitdiff
PCI PM: Fix pci_prepare_to_sleep
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 13 Jul 2008 20:45:06 +0000 (22:45 +0200)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 14 Jul 2008 21:25:44 +0000 (14:25 -0700)
The recently introduced pci_prepare_to_sleep() needs the following fix,
because there are systems which are not power manageable by ACPI (ie.
ACPI doesn't provide methods to put the device into low power states and
back), but require ACPI hooks to be executed for wake-up to work.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci.c

index e632a58ba5d0e1d8b2124f66ae271e1be7858b8c..ace518116cc5db887b7c35bc4478cd83c904507f 100644 (file)
@@ -1152,7 +1152,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev)
                                break;
                default:
                        target_state = state;
-                       pci_enable_wake(dev, target_state, true);
                }
        } else if (device_may_wakeup(&dev->dev)) {
                /*
@@ -1167,10 +1166,11 @@ int pci_prepare_to_sleep(struct pci_dev *dev)
                        while (target_state
                              && !(dev->pme_support & (1 << target_state)))
                                target_state--;
-                       pci_pme_active(dev, true);
                }
        }
 
+       pci_enable_wake(dev, target_state, true);
+
        error = pci_set_power_state(dev, target_state);
 
        if (error)