[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240227062648.16579-1-raag.jadav@intel.com>
Date: Tue, 27 Feb 2024 11:56:48 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: bhelgaas@...gle.com,
jarkko.nikula@...ux.intel.com,
mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com,
stanislaw.gruszka@...ux.intel.com,
lukas@...ner.de,
rafael@...nel.org,
ilpo.jarvinen@...ux.intel.com
Cc: linux-pci@...r.kernel.org,
linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org,
sashal@...nel.org,
Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v2] PCI / PM: Really allow runtime PM without callback functions
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.
Modify pci_pm_runtime_idle() such that it allows PCI device power state
transitions without runtime PM callbacks and complete the original
intention of commit c5eb1190074c ("PCI / PM: Allow runtime PM without
callback functions").
Signed-off-by: Raag Jadav <raag.jadav@...el.com>
Acked-by: Rafael J. Wysocki <rafael@...nel.org>
Tested-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@...ux.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.
Changes since v1:
- Update commit message and tags
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
Powered by blists - more mailing lists