]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
PCI / PM: Check device_may_wakeup() in pci_enable_wake()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 11 May 2018 18:41:53 +0000 (14:41 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 May 2018 07:08:41 +0000 (09:08 +0200)
commitbfb0d39a1cccdada9f9d7cab7f7ccf230eb8f78e
tree71f04340bc70a181e665e609cb3f177f524b1845
parentc422c60858974550a875930e829fdbe13fba780c
PCI / PM: Check device_may_wakeup() in pci_enable_wake()

BugLink: http://bugs.launchpad.net/bugs/1745646
Commit 0847684cfc5f0 (PCI / PM: Simplify device wakeup settings code)
went too far and dropped the device_may_wakeup() check from
pci_enable_wake() which causes wakeup to be enabled during system
suspend, hibernation or shutdown for some PCI devices that are not
allowed by user space to wake up the system from sleep (or power off).

As a result of this excessive power is drawn by some of the affected
systems while in sleep states or off.

Restore the device_may_wakeup() check in pci_enable_wake(), but make
sure that the PCI bus type's runtime suspend callback will not call
device_may_wakeup() which is about system wakeup from sleep and not
about device wakeup from runtime suspend.

Fixes: 0847684cfc5f0 (PCI / PM: Simplify device wakeup settings code)
Reported-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Cc: 4.13+ <stable@vger.kernel.org> # 4.13+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry-picked from cfcadfaad7251d8b640713724b388164d75465b2)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/pci/pci.c