]> git.baikalelectronics.ru Git - kernel.git/commit
PCI / PM: Allow runtime PM without callback functions
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Tue, 23 Oct 2018 11:45:52 +0000 (14:45 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 12 Dec 2018 21:37:43 +0000 (15:37 -0600)
commit9c48363442198aee2cb8e50d571a6caa4dba4499
treef3d1da218d59e1f781b14b49d60ef57caf73be38
parentf630c74755763954e46ada22cb887770a3c4fdd4
PCI / PM: Allow runtime PM without callback functions

59e66235c9b1 ("i2c: i801: Don't restore config registers on runtime PM")
nullified the runtime PM suspend/resume callback pointers while keeping the
runtime PM enabled.

This caused the SMBus PCI device to stay in D0 with
/sys/devices/.../power/runtime_status showing "error" when the runtime PM
framework attempted to autosuspend the device.  This is due to PCI bus
runtime PM, which checks for driver runtime PM callbacks and returns
-ENOSYS if they are not set.

Since i2c-i801.c doesn't need to do anything device-specific for runtime
PM, Jean Delvare proposed this be fixed in the PCI core rather than adding
dummy runtime PM callback functions in the PCI drivers.

Change pci_pm_runtime_suspend()/pci_pm_runtime_resume() so they allow
changing the PCI device power state during runtime PM transitions even if
the driver supplies no runtime PM callbacks.

This fixes the runtime PM regression on i2c-i801.c.

It is not obvious why the code previously required the runtime PM
callbacks.  The test has been there since the code was introduced by
80ac15670fa6 ("PCI PM: Run-time callbacks for PCI bus type").

On the other hand, a similar change was done to generic runtime PM
callbacks in 8451e7e62c0c ("PM / Runtime: Lenient generic runtime pm
callbacks").

Fixes: 59e66235c9b1 ("i2c: i801: Don't restore config registers on runtime PM")
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: stable@vger.kernel.org # v4.18+
drivers/pci/pci-driver.c