Skip to contentSkip to conversation

PM: runtime: Introduce one more usage counter guard

PATCH In review Rafael J. Wysocki 2 participants 2 messages Oct 1, 2025 – Oct 3, 2025 Power management core

lore
Share & tools
lore

Rafael J. Wysocki

author maintainer
#0 lore raw

PATCH 1/1 PM: runtime: Introduce one more usage counter guard

From: Rafael J. Wysocki <[email protected]>

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.

---

Commit 9a0abc39450a is there in my linux-next branch.

---
 include/linux/pm_runtime.h |    3 +++
 1 file changed, 3 insertions(+)
include/linux/pm_runtime.h +3 -0
@@ -610,6 +610,9 @@ static inline int pm_runtime_put_autosus
 	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 *,
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Wed, 01 Oct 2025 19:34:29 +0200 "Rafael J. Wysocki" <[email protected]>…

From: Rafael J. Wysocki <[email protected]>

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.

Make sense to complete the set.

Quoted 23 lines

---

Commit 9a0abc39450a is there in my linux-next branch.

---
 include/linux/pm_runtime.h |    3 +++
 1 file changed, 3 insertions(+)
include/linux/pm_runtime.h +3 -0
@@ -610,6 +610,9 @@ static inline int pm_runtime_put_autosus
 	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 *,