linux/drivers/pci
Mika Westerberg 9d26d3a8f1 PCI: Put PCIe ports into D3 during suspend
Currently the Linux PCI core does not touch power state of PCI bridges and
PCIe ports when system suspend is entered.  Leaving them in D0 consumes
power unnecessarily and may prevent the CPU from entering deeper C-states.

With recent PCIe hardware we can power down the ports to save power given
that we take into account few restrictions:

  - The PCIe port hardware is recent enough, starting from 2015.

  - Devices connected to PCIe ports are effectively in D3cold once the port
    is transitioned to D3 (the config space is not accessible anymore and
    the link may be powered down).

  - Devices behind the PCIe port need to be allowed to transition to D3cold
    and back.  There is a way both drivers and userspace can forbid this.

  - If the device behind the PCIe port is capable of waking the system it
    needs to be able to do so from D3cold.

This patch adds a new flag to struct pci_device called 'bridge_d3'.  This
flag is set and cleared by the PCI core whenever there is a change in power
management state of any of the devices behind the PCIe port.  When system
later on is suspended we only need to check this flag and if it is true
transition the port to D3 otherwise we leave it in D0.

Also provide override mechanism via command line parameter
"pcie_port_pm=[off|force]" that can be used to disable or enable the
feature regardless of the BIOS manufacturing date.

Tested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-06-13 14:57:36 -05:00
..
host Char / Misc driver update for 4.7-rc1 2016-05-20 21:20:31 -07:00
hotplug powerpc updates for 4.7 2016-05-20 10:12:41 -07:00
pcie PCI: Don't clear d3cold_allowed for PCIe ports 2016-06-13 14:51:34 -05:00
access.c PCI: Add pci_set_vpd_size() to set VPD size 2016-04-15 13:00:11 -05:00
ats.c
bus.c PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
ecam.c PCI: Provide common functions for ECAM mapping 2016-05-11 17:34:41 -05:00
ecam.h PCI: generic, thunder: Use generic ECAM API 2016-05-12 07:07:42 -05:00
host-bridge.c
hotplug-pci.c
htirq.c
iov.c powerpc updates for 4.6 2016-03-19 15:38:41 -07:00
irq.c
Kconfig PCI: Provide common functions for ECAM mapping 2016-05-11 17:34:41 -05:00
Makefile PCI: Provide common functions for ECAM mapping 2016-05-11 17:34:41 -05:00
msi.c PCI changes for the v4.5 merge window: 2016-01-21 11:52:16 -08:00
of.c
pci-acpi.c Power management and ACPI updates for v4.5-rc1 2016-01-12 20:25:09 -08:00
pci-driver.c PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
pci-label.c PCI: Fix broken URL for Dell biosdevname 2016-02-29 12:03:19 -06:00
pci-stub.c
pci-sysfs.c PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
pci.c PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
pci.h PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
probe.c Merge branches 'pci/hotplug' and 'pci/resource' into next 2016-05-17 14:35:38 -05:00
proc.c
quirks.c Merge branches 'pci/enumeration', 'pci/hotplug', 'pci/misc', 'pci/ntb', 'pci/thunderbolt' and 'pci/virtualization' into next 2016-04-25 14:35:26 -05:00
remove.c PCI: Put PCIe ports into D3 during suspend 2016-06-13 14:57:36 -05:00
rom.c PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY 2016-03-12 06:00:29 -06:00
search.c PCI: Add support for multiple DMA aliases 2016-04-11 14:34:32 -05:00
setup-bus.c PCI: Remove includes of empty asm-generic/pci-bridge.h 2016-02-05 16:28:36 -06:00
setup-irq.c
setup-res.c PCI: Don't assign or reassign immutable resources 2016-03-08 12:14:31 -06:00
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted. 2016-02-15 14:34:57 +00:00