linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Runtime PM for Thunderbolt on Macs
@ 2016-12-17 14:39 Lukas Wunner
  2016-12-17 14:39 ` [PATCH v3 5/7] PM: Make requirements of dev_pm_domain_set() more precise Lukas Wunner
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Lukas Wunner @ 2016-12-17 14:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Andreas Noever, linux-pci, linux-pm, Tomas Winkler, Amir Levy,
	Bjorn Helgaas, Mika Westerberg, Rafael J. Wysocki, Ulf Hansson,
	Tomeu Vizoso

Power down Thunderbolt controllers on Macs when nothing is plugged in
to save around 2W per controller.

Apple provides an ACPI-based (but nonstandard) mechanism to cut power
and signal hotplug during powerdown.  The usual way to implement such
nonstandard mechanisms seems to be a struct dev_pm_domain.
E.g. vga_switcheroo uses that for Optimus GPUs which control power
with ACPI DSMs.  Hence this third iteration of the series uses that
as well.  In v2 a more complicated approach was employed wherein power
control was exerted by a PCIe port service driver instead.

All the prep work went into 4.9 and 4.10, shrinking this series to just
7 patches:

- The actual "meat" of the series (to borrow a term from Bjorn) is in
  patches [6/7] and [7/7].  These two need an ack from Andreas.

- Patches [1/7] to [3/7] need an ack from Bjorn (and possibly Rafael or
  Mika).  They're fairly small and just add a bit to struct pci_dev
  signifying that a device is part of a Thunderbolt daisy chain, then
  use that bit to modify runtime PM for PCIe ports.  I'm also cc'ing
  Tomas and Amir at Intel Israel, if you guys have comments please shout.

- Patches [4/7] and [5/7] need an ack from Rafael.  Their sole purpose
  is to avoid a gratuitous WARN splat when assigning the struct
  dev_pm_domain.

I've pushed the patches to GitHub to ease reviewing/fetching:
https://github.com/l1k/linux/commits/thunderbolt_runpm_v3

Link to the previous iteration (v2, May 2016):
http://www.spinics.net/lists/linux-pci/msg51158.html

Thanks,

Lukas


Lukas Wunner (7):
  PCI: Recognize Thunderbolt devices
  PCI: Allow runtime PM on Thunderbolt ports
  PCI: Don't block runtime PM for Thunderbolt host hotplug ports
  Revert "PM / Runtime: Remove the exported function
    pm_children_suspended()"
  PM: Make requirements of dev_pm_domain_set() more precise
  thunderbolt: Power down controller when idle
  thunderbolt: Runtime suspend NHI when idle

 drivers/base/power/common.c  |  15 +-
 drivers/base/power/runtime.c |   3 +-
 drivers/pci/pci.c            |  20 ++-
 drivers/pci/pci.h            |   2 +
 drivers/pci/probe.c          |  34 +++++
 drivers/thunderbolt/Kconfig  |   3 +-
 drivers/thunderbolt/Makefile |   4 +-
 drivers/thunderbolt/nhi.c    |   5 +
 drivers/thunderbolt/power.c  | 356 +++++++++++++++++++++++++++++++++++++++++++
 drivers/thunderbolt/power.h  |  37 +++++
 drivers/thunderbolt/switch.c |   9 ++
 drivers/thunderbolt/tb.c     |  13 ++
 drivers/thunderbolt/tb.h     |   2 +
 include/linux/pci.h          |   1 +
 include/linux/pm_runtime.h   |   7 +
 15 files changed, 500 insertions(+), 11 deletions(-)
 create mode 100644 drivers/thunderbolt/power.c
 create mode 100644 drivers/thunderbolt/power.h

-- 
2.10.2

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

end of thread, other threads:[~2016-12-21 10:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-17 14:39 [PATCH v3 0/7] Runtime PM for Thunderbolt on Macs Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 5/7] PM: Make requirements of dev_pm_domain_set() more precise Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 3/7] PCI: Don't block runtime PM for Thunderbolt host hotplug ports Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 6/7] thunderbolt: Power down controller when idle Lukas Wunner
2016-12-18 23:05   ` Andy Shevchenko
2016-12-20 11:28     ` Lukas Wunner
2016-12-20 13:44       ` Andy Shevchenko
2016-12-21 10:53         ` Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 4/7] Revert "PM / Runtime: Remove the exported function pm_children_suspended()" Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 1/7] PCI: Recognize Thunderbolt devices Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 2/7] PCI: Allow runtime PM on Thunderbolt ports Lukas Wunner
2016-12-17 14:39 ` [PATCH v3 7/7] thunderbolt: Runtime suspend NHI when idle Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).