rpm_suspend(9)
π rpm_suspend(9) β from the Kernel API Manual, bestie
okay so picture this: it's a whole manpage, it's called rpm_suspend, it lives in the Kernel API Manual, and it's about to become your new hyperfixation. runtime PM girlies rise π«Ά
β¨ NAME β¨
rpm_suspend β literally just: carry out runtime suspend of given device. that's it, that's the whole gig π
πΈ SYNOPSIS πΈ
int rpm_suspend (struct device *dev , int rpmflags );
π ARGUMENTS π
devβ the device you're putting to sleep. the main character of this operation. π΄rpmflagsβ the flag bits. lil vibes knobs that change how the suspend goes down.
π¦ DESCRIPTION π¦
okay so first thing: it checks whether the device's runtime PM status even allows it to be suspended. vibe check before the nap, yk? β
then it cancels a pending idle notification, autosuspend or suspend. like clearing the group chat notifications before you actually go offline, periodt.
if another suspend has already been started earlier, it'll either return immediately or wait for it to finish β which one depends on the RPM_NOWAIT and RPM_ASYNC flags. no cap, those two flags are running the whole show here.
if the RPM_ASYNC flag is set, then it queues a suspend request; otherwise it runs the ->runtime_suspend callback directly. like, right there, in the moment.
when ->runtime_suspend succeeded β and if a deferred resume was requested while the callback was running β then it carries that resume out. otherwise it sends an idle notification for its parent, but only if the suspend succeeded and both ignore_children of parent->power and irq_safe of dev->power are not set. both. not one. both. π
and if ->runtime_suspend failed with -EAGAIN or -EBUSY? then, if the RPM_AUTO flag is set and the next autosuspend-delay expiration time is in the future, it schedules another autosuspend attempt. it's giving "we try again, we heal, we grow" π±
β οΈ now the serious part, bestie, don't skip it: this function must be called under dev->power.lock with interrupts disabled. not "should", not "ideally" β must. the lock is non-negotiable, and interrupts stay off. no exceptions π
π₯ SEE ALSO π₯
the source file, absolutely iconic of it:
- Kernel file
./drivers/base/power/runtime.c
and the whole friend group, in order, because we do not leave anyone out π«Ά:
update_pm_runtime_accounting(9)pm_runtime_deactivate_timer(9)pm_runtime_cancel_pending(9)rpm_check_suspend_allowed(9)pm_runtime_release_supplier(9)__rpm_callback(9)rpm_callback(9)rpm_idle(9)rpm_resume(9)pm_runtime_work(9)pm_suspend_timer_fn(9)pm_schedule_suspend(9)__pm_runtime_idle(9)__pm_runtime_suspend(9)__pm_runtime_resume(9)pm_runtime_get_conditional(9)pm_runtime_get_if_active(9)pm_runtime_get_if_in_use(9)__pm_runtime_set_status(9)__pm_runtime_barrier(9)pm_runtime_barrier(9)pm_runtime_enable(9)devm_pm_runtime_set_active_enabled(9)devm_pm_runtime_enable(9)devm_pm_runtime_get_noresume(9)pm_runtime_forbid(9)pm_runtime_allow(9)pm_runtime_no_callbacks(9)pm_runtime_irq_safe(9)update_autosuspend(9)pm_runtime_set_autosuspend_delay(9)__pm_runtime_use_autosuspend(9)pm_runtime_init(9)pm_runtime_reinit(9)pm_runtime_remove(9)pm_runtime_get_suppliers(9)pm_runtime_put_suppliers(9)pm_runtime_drop_link(9)pm_runtime_force_suspend(9)pm_runtime_force_resume(9)
okay that's the whole page, you ate that π
sign-off time: this lil masterpiece comes from ./drivers/base/power, dated October 2026, and it's page rpm_suspend(9) of the Kernel API Manual. mwah. π
π¦ 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