diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-02-27 11:47:33 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-03-03 14:35:07 +0100 |
commit | 1476bb20eec33bd68b67c7bb7a5d62063af8148d (patch) | |
tree | 298c5de61bae671f0d922d864c598f6e1a0f61d6 /drivers/base/power/runtime.c | |
parent | cb88c229fe77ea16cef2b9c8154cf44d331818a6 (diff) |
PM: runtime: Convert pm_runtime_blocked() to static inline
The comment in pm_runtime_blocked() is acutally wrong: power.last_status
is not a bit field. Its data type is an enum and so one can reasonably
assume that partial updates of it will not be observed.
Accordingly, pm_runtime_blocked() can be converted to a static inline
function and the related locking overhead can be eliminated, so long
as it is only used in system suspend/resume code paths because
power.last_status is not expected to be updated concurrently while
that code is running.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/1923449.tdWV9SEqCh@rjwysocki.net
Diffstat (limited to 'drivers/base/power/runtime.c')
-rw-r--r-- | drivers/base/power/runtime.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 3d08eb677177..42a58ed45a08 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1560,23 +1560,6 @@ out: } EXPORT_SYMBOL_GPL(pm_runtime_enable); -bool pm_runtime_blocked(struct device *dev) -{ - bool ret; - - /* - * dev->power.last_status is a bit field, so in case it is updated via - * RMW, read it under the spin lock. - */ - spin_lock_irq(&dev->power.lock); - - ret = dev->power.last_status == RPM_BLOCKED; - - spin_unlock_irq(&dev->power.lock); - - return ret; -} - static void pm_runtime_disable_action(void *data) { pm_runtime_dont_use_autosuspend(data); |