pm_runtime_put_sync_suspend(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 PM child_count is non-zero. the kids aren't letting her rest. πŸ’€
  • -EPERM β€” device PM QoS resume latency is 0.
  • -ENOSYS β€” CONFIG_PM not 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