linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] PCI / PM: Really allow runtime PM without callback functions
@ 2024-02-12  6:32 Raag Jadav
  2024-02-13 14:02 ` Rafael J. Wysocki
  2024-02-13 20:06 ` Bjorn Helgaas
  0 siblings, 2 replies; 12+ messages in thread
From: Raag Jadav @ 2024-02-12  6:32 UTC (permalink / raw)
  To: bhelgaas, jarkko.nikula, mika.westerberg, andriy.shevchenko,
	stanislaw.gruszka, lukas, rafael, ilpo.jarvinen
  Cc: linux-pci, linux-pm, linux-kernel, gregkh, sashal, Raag Jadav

Commit c5eb1190074c ("PCI / PM: Allow runtime PM without callback
functions") tried to eliminate the need for runtime PM callbacks
by modifying pci_pm_runtime_suspend() and pci_pm_runtime_resume(),
but didn't modify pci_pm_runtime_idle() with relevant changes, which
still returns -ENOSYS if the driver supplies no runtime PM callbacks.

Fix this by modifying pci_pm_runtime_idle() such that it allows PCI
device power state transitions without runtime PM callbacks.

 0)               |  pm_runtime_work() {
 0)               |    rpm_idle() {
 0)               |      rpm_check_suspend_allowed() {
 0)   1.500 us    |        __dev_pm_qos_resume_latency(); /* = 0x7fffffff */
 0)   4.840 us    |      } /* rpm_check_suspend_allowed = 0x0 */
 0)   1.550 us    |      __rpm_get_callback(); /* = 0xffffffffb4bc84f0 */
 0)   1.800 us    |      pci_pm_runtime_idle(); /* = -38 */
 0) + 17.070 us   |    } /* rpm_idle = -38 */
 0) + 22.450 us   |  } /* pm_runtime_work = -38 */

Debugged-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---

This is not marked for linux-stable for the need of extensive testing
and can be backported after a few releases if no issues are reported.

 drivers/pci/pci-driver.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 51ec9e7e784f..bb7f6775b350 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1382,10 +1382,7 @@ static int pci_pm_runtime_idle(struct device *dev)
 	if (!pci_dev->driver)
 		return 0;
 
-	if (!pm)
-		return -ENOSYS;
-
-	if (pm->runtime_idle)
+	if (pm && pm->runtime_idle)
 		return pm->runtime_idle(dev);
 
 	return 0;
-- 
2.35.3


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

end of thread, other threads:[~2024-02-26  7:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12  6:32 [PATCH v1] PCI / PM: Really allow runtime PM without callback functions Raag Jadav
2024-02-13 14:02 ` Rafael J. Wysocki
2024-02-13 20:06 ` Bjorn Helgaas
2024-02-14  6:58   ` Jarkko Nikula
2024-02-14 16:58     ` Bjorn Helgaas
2024-02-14 20:15       ` Raag Jadav
2024-02-26  7:35         ` Raag Jadav
2024-02-26  7:41           ` Mika Westerberg
2024-02-14 10:43   ` Raag Jadav
2024-02-14 13:01     ` Andy Shevchenko
2024-02-14 13:20       ` Raag Jadav
2024-02-14 16:06         ` Bjorn Helgaas

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).