pm_runtime_idle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ pm_runtime_idle(9) β€” a Kernel API Manual moment ✨

okay so bestie, we're diving into the Kernel API Manual today and honestly? this one is a lil gem πŸ’Ž it's giving "will you please chill out and go to sleep" but for devices. let's get into it 🫢


πŸ’€ NAME πŸ’€

pm_runtime_idle β€” conditionally set up autosuspend of a device or suspend it.

like, conditionally. that word is doing SO much heavy lifting here, keep an eye on it πŸ‘€


πŸŽ€ SYNOPSIS πŸŽ€

int pm_runtime_idle (struct device *dev );

one function, one pointer, zero drama ✨


🌸 ARGUMENTS 🌸

  • dev β€” the target device. the main character of this whole operation πŸ‘‘ that's the one we're trying to get to relax.

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: pm_runtime_idle invokes the "idle check" callback of dev, and then β€” depending on what that callback hands back to us β€” it either sets up autosuspend of dev or suspends it. which one? that depends on whether or not autosuspend has been enabled for it. iykyk πŸ’…

it's like asking your friend "hey are you sleepy?" and the answer decides whether you set an alarm for them or just tuck them in right now 😴


πŸ’€ RETURN πŸ’€

the numbers bestie, the numbers πŸ‘‡

  • 0 β€” Success. slay, we ate πŸŽ‰
  • -EINVAL β€” Runtime PM error.
  • -EACCES β€” Runtime PM disabled.
  • -EAGAIN β€” Runtime PM usage counter non-zero, Runtime PM status change ongoing, or device not in RPM_ACTIVE state. (yes, three possible reasons, she contains multitudes 🫠)
  • -EBUSY β€” Runtime PM child_count non-zero.
  • -EPERM β€” Device PM QoS resume latency 0.
  • -EINPROGRESS β€” Suspend already in progress. it's already happening, bestie, let it cook πŸ”₯
  • -ENOSYS β€” CONFIG_PM not enabled.
⚠️ note bestie: other values and conditions for the above values are possible as returned by Runtime PM idle and suspend callbacks. so like, don't come for me if you see something else, it's not me it's the callbacks 😭

🧚 SEE ALSO 🧚

okay this list is LONG and honestly iconic β€” the whole runtime PM friend group came out for this one πŸŒˆπŸ’œ Kernel file ./include/linux/pm_runtime.h:


and that's the whole page bestie, no cap 🫢 this one lives over in ./include/linux and it's dated October 2026 β€” see you next time, mwah πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from