• Mika Westerberg's avatar
    PCI / ACPI: Enable wake automatically for power managed bridges · 1997aecd
    Mika Westerberg authored
    [ Upstream commit 6299cf9e ]
    
    We enable power management automatically for bridges where
    pci_bridge_d3_possible() returns true. However, these bridges may have
    ACPI methods such as _DSW that need to be called before D3 entry. For
    example in Lenovo Thinkpad X1 Carbon 6th _DSW method is used to prepare
    D3cold for the PCIe root port hosting Thunderbolt chain. Because wake is
    not enabled _DSW method is never called and the port does not enter
    D3cold properly consuming more power than necessary.
    
    Users can work this around by writing "enabled" to "wakeup" sysfs file
    under the device in question but that is not something an ordinary user
    is expected to do.
    
    Since we already automatically enable power management for PCIe ports
    with ->bridge_d3 set extend that to enable wake for them as well,
    assuming the port has any ACPI wakeup related objects implemented in the
    namespace (adev->wakeup.flags.valid is true). This ensures the necessary
    ACPI methods get called at appropriate times and allows the root port in
    Thinkpad X1 Carbon 6th to go into D3cold.
    Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    1997aecd
pci-acpi.c 22.4 KB