pm_runtime_irq_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pm_runtime_irq_safe(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” yes, that's the manual name, we're fancy here ✨ this page is legit called pm_runtime_irq_safe, and honestly? it's giving "small function, huge consequences" energy. let's get into it πŸŽ€


✨ NAME ✨

pm_runtime_irq_safe β€” the one where we leave interrupts disabled during callbacks 😭 yeah. that's the whole vibe. no cap.


🌸 SYNOPSIS 🌸

void pm_runtime_irq_safe (struct device *dev );

literally one line, one argument, zero mercy πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device we're handling, aka the main character of this whole operation πŸ‘‘

she's a struct device * and she's the only one invited to this function. periodt.


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, bestie β˜• this function sets the power.irq_safe flag. and what does that flag do? it tells the PM core that the ->runtime_suspend and ->runtime_resume callbacks for this device should always be invoked with the spinlock held and interrupts disabled 🫢 like, every single time, no exceptions, that's just how it is now.

and that's not even the whole story. it also causes the parent's usage counter to be permanently incremented β€” which means the parent can never runtime suspend. ever. 😳 and why? because otherwise an irq-safe child might have to wait for a non-irq-safe parent, and that would be a whole mess. so the kernel just... keeps the parent awake forever. iconic, honestly πŸ’…

tl;dr: you're making a permanent commitment here. the parent is locked in. iykyk.


πŸ”₯ SEE ALSO πŸ”₯

🧚 the source file

  • Kernel file ./drivers/base/power/runtime.c

⭐ the whole friend group (go say hi)

like, that's a whole squad right there 🌈 you're never gonna be lonely in this header file, that's for sure 🫢


πŸ’€ friendly reminder: irq_safe = interrupts stay off in those callbacks. if your callback was planning to sleep? it cannot. it simply cannot. don't do it. respect the flag πŸ™ˆ

πŸŽ€ okay that's the page!! brought to you by ./drivers/base/power, dated October 2026, and signed off by pm_runtime_irq_safe(9) herself β€” she said stan her or else βœ¨πŸ’– byeee πŸ¦‹

πŸ“¦ where this page comes from