]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PCI: Activate runtime PM on a PCIe port only if it can suspend
authorLukas Wunner <lukas@wunner.de>
Fri, 28 Oct 2016 08:52:06 +0000 (10:52 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 18 Nov 2016 00:46:06 +0000 (18:46 -0600)
commitc6a6330706148e7d5265c3dd658d25843c83390f
tree3a6084b514e490879976faa75fb9efc9f8b7638a
parente8559b7100324494acbde6e26bcdc6a5a5b4a4ed
PCI: Activate runtime PM on a PCIe port only if it can suspend

Currently pcie_portdrv_probe() activates runtime PM on a PCIe port even
if it will never actually suspend because the BIOS is too old or the
"pcie_port_pm=off" option was specified on the kernel command line.

A few CPU cycles can be saved by not activating runtime PM at all in these
cases, because rpm_idle() and rpm_suspend() will bail out right at the
beginning when calling rpm_check_suspend_allowed(), instead of carrying out
various locking and assignments, invoking rpm_callback(), getting back
-EBUSY and rolling everything back.

The conditions checked in pci_bridge_d3_possible() are all static, they
never change during uptime of the system, hence it's safe to call this to
determine if runtime PM should be activated.

No functional change intended.

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/pcie/portdrv_pci.c