All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] PCI: Add support for suspending (including runtime) of PCIe ports
@ 2016-04-08 10:36 Mika Westerberg
  2016-04-08 10:36 ` [PATCH v2 1/4] PCI: No need to set d3cold_allowed to " Mika Westerberg
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Mika Westerberg @ 2016-04-08 10:36 UTC (permalink / raw)
  To: Bjorn Helgaas, Rafael J. Wysocki
  Cc: Qipeng Zha, Qi Zheng, Dave Airlie, Mathias Nyman,
	Greg Kroah-Hartman, Mika Westerberg, linux-pci, linux-pm

Current Linux PCI core does not do any kind of power management to PCIe
ports. This means that we waste energy and consume laptop battery even if
the port has nothing connected to. These patches aim to change that to the
right direction.

The first version of the patches can be found here:

  http://www.spinics.net/lists/linux-pci/msg49313.html

This assumes that recent (starting from 2015) PCIe ports are capable of
transition to D3hot/D3cold. We add a new flag to struct pci_dev 'bridge_d3'
that is set whenever the PCI core thinks the port can be put to D3. The
check in pci_pm_suspend_noirq() is then extended to cover devices where
'bridge_d3' is set.

We then add pci_bridge_pm_update() that tries to set/clear 'bridge_d3'
whenever power management status of a device is changed. For example when
userspace writes to 'd3cold_allowed' sysfs file.

For all PCI ports where 'bridge_d3' is set we also enable and unblock
runtime PM automatically. Only exception is when the PCIe port claims to
support hotplug. More information about that is in the changelog of patch
[4/4].

Since this also touches xhci, I'm adding Mathias and Greg to check if the
change looks reasonable.

Changes to the previous version:

  - Dropped patch [2/6] as there is no need to use that function from other
    files anymore.

  - Dropped patches [5-6/6] in favor of using cut-off date.

  - Updated changelog of [1/4] to mention where in the PCI core PCI bridge
    and PCIe ports are skipped from being power managed.

  - Instead of checking at suspend time if it is possible to transition the
    port to D3, do it whenever power management status of a device (below a
    port) is changed or when it is added or removed to the bus.

  - Added patch [3/4] to runtime resume a bridge when ACPI hotplug event is
    received.

Please review.

Mika Westerberg (4):
  PCI: No need to set d3cold_allowed to PCIe ports
  PCI: Move PCIe ports to D3 during suspend
  ACPI / hotplug / PCI: Runtime resume bridge before rescan
  PCI: Add runtime PM support for PCIe ports

 drivers/pci/bus.c                  |   1 +
 drivers/pci/hotplug/acpiphp_glue.c |   8 ++-
 drivers/pci/pci-driver.c           |  15 +++++-
 drivers/pci/pci-sysfs.c            |   1 +
 drivers/pci/pci.c                  | 103 +++++++++++++++++++++++++++++++++++++
 drivers/pci/pci.h                  |   1 +
 drivers/pci/pcie/portdrv_pci.c     |  90 ++++++++++++++++++++++++++++++--
 drivers/pci/remove.c               |   2 +
 drivers/usb/host/xhci-pci.c        |   2 +-
 include/linux/pci.h                |   2 +
 10 files changed, 216 insertions(+), 9 deletions(-)

-- 
2.8.0.rc3


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-04-24 16:10 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 10:36 [PATCH v2 0/4] PCI: Add support for suspending (including runtime) of PCIe ports Mika Westerberg
2016-04-08 10:36 ` [PATCH v2 1/4] PCI: No need to set d3cold_allowed to " Mika Westerberg
2016-04-08 10:36 ` [PATCH v2 2/4] PCI: Move PCIe ports to D3 during suspend Mika Westerberg
2016-04-08 15:07   ` Greg Kroah-Hartman
2016-04-11  8:47     ` Mika Westerberg
2016-04-11  3:36   ` Zheng, Qi
2016-04-11  8:56     ` Mika Westerberg
2016-04-11 13:38       ` Rafael J. Wysocki
2016-04-12  6:51         ` Mika Westerberg
2016-04-12 17:45   ` Lukas Wunner
2016-04-13  8:34     ` Mika Westerberg
2016-04-08 10:36 ` [PATCH v2 3/4] ACPI / hotplug / PCI: Runtime resume bridge before rescan Mika Westerberg
2016-04-08 10:36 ` [PATCH v2 4/4] PCI: Add runtime PM support for PCIe ports Mika Westerberg
2016-04-12 17:52   ` Lukas Wunner
2016-04-13  8:33     ` Mika Westerberg
2016-04-13  9:08       ` Andreas Noever
2016-04-13  9:16         ` Mika Westerberg
2016-04-18 14:38       ` Lukas Wunner
2016-04-19 12:31         ` Mika Westerberg
2016-04-20 19:22           ` Lukas Wunner
2016-04-20 20:23             ` Rafael J. Wysocki
2016-04-21 13:12               ` Mika Westerberg
2016-04-21 19:19                 ` Rafael J. Wysocki
2016-04-21 23:25                   ` Andreas Noever
2016-04-22  0:26                     ` Rafael J. Wysocki
2016-04-22  9:10                       ` Mika Westerberg
2016-04-22 12:37                         ` Rafael J. Wysocki
2016-04-21 13:10             ` Mika Westerberg
2016-04-24 16:13               ` Lukas Wunner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.