]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PM: core: Tweak pm_runtime_block_if_disabled() return value
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 27 Feb 2025 10:49:12 +0000 (11:49 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 3 Mar 2025 13:35:07 +0000 (14:35 +0100)
commita84c2a885bc62a61e08fbcd9976a2a40400470c0
treeae6a659fb72c98884a14171e804d030d71ff707b
parent1476bb20eec33bd68b67c7bb7a5d62063af8148d
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
drivers/base/power/main.c
drivers/base/power/runtime.c