__pm_runtime..._autosuspend(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ __pm_runtime..._autosuspend β€” a Kernel API Manual moment πŸ’…

okay so bestie, welcome to the kernel API manual, this one's about __pm_runtime..._autosuspend and honestly it's giving "one tiny function, whole lot of lore" ✨


🌸 NAME 🌸

__pm_runtime_put_autosuspend β€” drop the device usage counter and, if it hits 0, queue up an autosuspend. that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

int __pm_runtime_put_autosuspend (struct device *dev );

🫢 ARGUMENTS 🫢

  • dev β€” the target device. the main character of this whole operation πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

so what it does: it decrements the runtime PM usage counter on dev, and if that counter turns out to be equal to 0, it queues up a work item for dev β€” exactly like in pm_request_autosuspend. no cap, that's it. lowkey elegant 🧚


πŸ”₯ RETURN πŸ”₯

  • 1 β€” success! πŸŽ‰ the usage counter dropped to zero, but the device was already suspended. so like, mission accomplished, nobody had to do anything.
  • 0 β€” success. periodt.
  • -EINVAL β€” runtime PM error 😭
  • -EACCES β€” runtime PM is disabled πŸ™ˆ
  • -EAGAIN β€” the runtime PM usage counter became non-zero, or a runtime PM status change is ongoing. awkward πŸ’€
  • -EBUSY β€” the runtime PM child_count is non-zero. the children said "not today" πŸ‘‘
  • -EPERM β€” device PM QoS resume latency is 0.
  • -EINPROGRESS β€” a suspend is already in progress, bestie, hold please ⏳
  • -ENOSYS β€” CONFIG_PM isn't enabled. so the function is literally not a thing here πŸ’…

🌈 SEE ALSO 🌈

kernel file ./include/linux/pm_runtime.h, plus the whole friend group 🫢:


ngl the ... in the title is doing a lot of heavy lifting, but that's the page name and we respect it πŸŽ€

okay that's the whole read, mwah πŸ’‹ this page lives in ./include/linux and it's dated October 2026 β€” iykyk, go forth and suspend responsibly bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from