diff options
author | 2025-02-18 21:20:46 +0100 | |
---|---|---|
committer | 2025-03-03 13:29:00 +0100 | |
commit | 520a552f19d55825108ab83da093084c9afb50e9 (patch) | |
tree | 0aef7e72ac0bd67180fd9a0db8f1ddc47a5bbe03 /include/linux/pm_runtime.h | |
parent | PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally (diff) | |
download | wireguard-linux-520a552f19d55825108ab83da093084c9afb50e9.tar.xz wireguard-linux-520a552f19d55825108ab83da093084c9afb50e9.zip |
PM: sleep: Avoid unnecessary checks in device_prepare_smart_suspend()
Add an optimization (on top of previous changes) to avoid calling
pm_runtime_blocked(), which involves acquiring the device's PM spinlock,
for devices with no PM callbacks and runtime PM "blocked".
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/2978873.e9J7NaK4W3@rjwysocki.net
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index aea0395c10a1..01ead602aedd 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -77,7 +77,7 @@ extern int pm_runtime_get_if_in_use(struct device *dev); extern int pm_schedule_suspend(struct device *dev, unsigned int delay); extern int __pm_runtime_set_status(struct device *dev, unsigned int status); extern int pm_runtime_barrier(struct device *dev); -extern void pm_runtime_block_if_disabled(struct device *dev); +extern bool pm_runtime_block_if_disabled(struct device *dev); extern void pm_runtime_unblock(struct device *dev); extern void pm_runtime_enable(struct device *dev); extern void __pm_runtime_disable(struct device *dev, bool check_resume); @@ -274,7 +274,7 @@ static inline int pm_runtime_get_if_active(struct device *dev) static inline int __pm_runtime_set_status(struct device *dev, unsigned int status) { return 0; } static inline int pm_runtime_barrier(struct device *dev) { return 0; } -static inline void pm_runtime_block_if_disabled(struct device *dev) {} +static inline bool pm_runtime_block_if_disabled(struct device *dev) { return true; } static inline void pm_runtime_unblock(struct device *dev) {} static inline void pm_runtime_enable(struct device *dev) {} static inline void __pm_runtime_disable(struct device *dev, bool c) {} |