]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM: runtime: Introduce one more usage counter guard
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 1 Oct 2025 17:34:29 +0000 (19:34 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 3 Oct 2025 19:09:54 +0000 (21:09 +0200)
Follow previous commit 9a0abc39450a ("PM: runtime: Add auto-cleanup
macros for "resume and get" operations") and define a runtime PM
usage counter guard in which pm_runtime_get_noresume() and
pm_runtime_put_noidle() will be used for incrementing and
decrementing it, respectively.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameorn@huawei.com>
include/linux/pm_runtime.h

index edb8aed5ef62eb7f385d00c54b792566482a24e9..a3f44f6c2da1cceb8b8399b929878ca036f211a8 100644 (file)
@@ -614,6 +614,9 @@ static inline int pm_runtime_put_autosuspend(struct device *dev)
        return __pm_runtime_put_autosuspend(dev);
 }
 
+DEFINE_GUARD(pm_runtime_noresume, struct device *,
+            pm_runtime_get_noresume(_T), pm_runtime_put_noidle(_T));
+
 DEFINE_GUARD(pm_runtime_active, struct device *,
             pm_runtime_get_sync(_T), pm_runtime_put(_T));
 DEFINE_GUARD(pm_runtime_active_auto, struct device *,