pm_runtime_put_sync_suspend(9)
π pm_runtime_put_sync_suspend(9) π
okay bestie, so this is a page straight out of the Kernel API Manual β yes, the kernel, as in the thing that runs literally everything. and the star of today's episode is pm_runtime_put_sync_suspend. she's a runtime power-management girlie and she's about to drop a counter and maybe put your device to sleep. iconic behavior honestly. π
β¨ NAME β¨
pm_runtime_put_sync_suspend β drop device usage counter and suspend if 0. that's it. that's the whole personality. π
π¦ SYNOPSIS π¦
int pm_runtime_put_sync_suspend (struct device *dev );
πΈ ARGUMENTS πΈ
devβ the target device. your main character. the one whose counter we're about to decrement. π«Ά
π DESCRIPTION π
so here's the vibe: this function decrements the runtime PM usage counter of dev, and then β and this is the moment β if that counter turns out to be equal to 0, she goes ahead and carries out a runtime-suspend of dev synchronously. like, right then, no waiting around, no "I'll get to it later". periodt. β¨
and here's the part you gotta remember, bestie, because it's a whole mood:
the runtime PM usage counter of dev remains decremented in all cases β even if the function returns an error code. no take-backs. the counter stays down. π
π₯ RETURN π₯
the return values are giving "it depends" energy but every single one is here, so read carefully:
1β success! usage counter dropped to zero, but the device was already suspended. she was already napping, you just checked on her. π΄0β success. plain and simple. slay. π-EINVALβ runtime PM error.-EACCESβ runtime PM disabled.-EAGAINβ runtime PM usage counter became non-zero, or a runtime PM status change is ongoing.-EBUSYβ runtime PMchild_countis non-zero. the kids aren't letting her rest. π-EPERMβ device PM QoS resume latency is0.-ENOSYSβCONFIG_PMnot enabled.
also ngl, other values and conditions for the above values are possible β as returned by Runtime PM suspend callbacks. so like, don't come for me if a callback hands you something unexpected. π
π SEE ALSO π
okay this is the whole group chat, buckle up π§:
kernel file ./include/linux/pm_runtime.h, plus:
pm_suspend_ignore_children(9), pm_runtime_get_noresume(9), pm_runtime_put_noidle(9), pm_runtime_suspended(9), pm_runtime_active(9), pm_runtime_status_suspended(9), pm_runtime_enabled(9), pm_runtime_blocked(9), pm_runtime_has_no_callbacks(9), pm_runtime_mark_last_busy(9), pm_runtime_is_irq_safe(9), pm_runtime_idle(9), pm_runtime_suspend(9), pm_runtime_autosuspend(9), pm_runtime_resume(9), pm_request_idle(9), pm_request_resume(9), pm_request_autosuspend(9), pm_runtime_get(9), pm_runtime_get_sync(9), pm_runtime_resume_and_get(9), pm_runtime_put(9), __pm_runtime_put_autosuspend(9), pm_runtime_put_autosuspend(9), pm_runtime_put_sync(9), pm_runtime_put_sync_autosuspend(9), pm_runtime_set_active(9), pm_runtime_set_suspended(9), pm_runtime_disable(9), pm_runtime_use_autosuspend(9), pm_runtime_dont_use_autosuspend(9)
and that's the page, bestie!! π«Ά this little beauty lives in ./include/linux, and this edition is dated October 2026 β go off, kernel docs, you ate. π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms