]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Query platform firmware for device power state
authorLukas Wunner <lukas@wunner.de>
Sun, 18 Sep 2016 03:39:20 +0000 (05:39 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 Sep 2016 16:46:51 +0000 (11:46 -0500)
commit26b7148125c2824ce2461be9816c08439367ab16
treef1d963b141e5d6fae283afa49e4841faeeedb6e8
parent97d54507f2dcddc0d0946fcf8715d85e031c875c
PCI: Query platform firmware for device power state

Usually the most accurate way to determine a PCI device's power state is to
read its PM Control & Status Register.  There are two cases however when
this is not an option:  If the device doesn't have the PM capability at
all, or if it is in D3cold (in which case its config space is
inaccessible).

In both cases, we can alternatively query the platform firmware for its
opinion on the device's power state.  To facilitate this, augment struct
pci_platform_pm_ops with a ->get_power callback and implement it for
acpi_pci_platform_pm (the only pci_platform_pm_ops existing so far).

It is used by a forthcoming commit to let pci_update_current_state()
recognize D3cold.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/pci-acpi.c
drivers/pci/pci.c
drivers/pci/pci.h