summaryrefslogtreecommitdiff
path: root/drivers/base/power/main.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-02-27 11:49:12 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-03-03 14:35:07 +0100
commita84c2a885bc62a61e08fbcd9976a2a40400470c0 (patch)
treeae6a659fb72c98884a14171e804d030d71ff707b /drivers/base/power/main.c
parent1476bb20eec33bd68b67c7bb7a5d62063af8148d (diff)
PM: core: Tweak pm_runtime_block_if_disabled() return value
Modify pm_runtime_block_if_disabled() to return true when runtime PM is disabled for the device, regardless of the power.last_status value. This effectively prevents "smart suspend" from being enabled for devices with runtime PM disabled in device_prepare(), even transiently, so update the related comment in that function accordingly. If a device has runtime PM disabled in device_prepare(), it is not actually known whether or not runtime PM will be enabled for that device going forward, so it is more appropriate to postpone the "smart suspend" optimization for the device in the given system suspend-resume cycle than to enable it and get confused going forward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://patch.msgid.link/13718674.uLZWGnKmhe@rjwysocki.net
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r--drivers/base/power/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 2f86d7cfdbbc..9215ec9f326b 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1897,7 +1897,7 @@ unlock:
pm_runtime_put(dev);
return ret;
}
- /* Do not enable "smart suspend" for devices without runtime PM. */
+ /* Do not enable "smart suspend" for devices with disabled runtime PM. */
if (smart_suspend)
smart_suspend = device_prepare_smart_suspend(dev);