• Rafael J. Wysocki's avatar
    PCI / PM: Check device_may_wakeup() in pci_enable_wake() · cfcadfaa
    Rafael J. Wysocki authored
    Commit 0847684c (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: 0847684c (PCI / PM: Simplify device wakeup settings code)
    Reported-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
    Cc: 4.13+ <stable@vger.kernel.org> # 4.13+
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    cfcadfaa
pci.c 153 KB