__pm_runtime_set_status(9)
π __pm_runtime_set_status(9) β the kernel API manual, but make it make sense π«Ά
okay bestie, so this one lives in the Kernel API Manual (section 9 of the man pages, iykyk) and it's literally the function that tells a device what its runtime PM status is. Let's get into it β¨
πΈ NAME πΈ
__pm_runtime_set_status β Set runtime PM status of a device.
π¦ SYNOPSIS π¦
int __pm_runtime_set_status (struct device *dev , unsigned int status );
π ARGUMENTS π
devβ the device you're handling. the main character of this whole operation πstatusβ the new runtime PM status of the device. this is what you're setting it to, bestie.
π DESCRIPTION π
okay so here's the tea β β if runtime PM of the device is disabled, or its power.runtime_error field is different from zero (i.e. not zero, so something's flagged), then the status may be changed either to RPM_ACTIVE, or to RPM_SUSPENDED β as long as that actually reflects the real, actual state of the device. no cap, that's the condition. π«Ά
but here's where it gets spicy πΆοΈ β if the device has a parent, and the parent is not active, and the parent's power.ignore_children flag is unset, then the device's status cannot be set to RPM_ACTIVE. so you get -EBUSY returned in that case. sorry bestie, the parent said no π
if it's successful, __pm_runtime_set_status clears the power.runtime_error field, and the device parent's counter of unsuspended children is modified to reflect the new status. slay. β¨ and if the new status is RPM_SUSPENDED, an idle notification request for the parent gets submitted. consider the parent notified π¬
and one more thing (there's always one more thing π) β if dev has any suppliers (as reflected by device links to them), and status is RPM_ACTIVE, they will be activated upfront. and if the activation of one of them fails, the status of dev will be changed to RPM_SUSPENDED (instead of the status value you passed), and the suppliers will be deacticated on exit. the error returned by the failing supplier activation will be returned in that case. so yeah β it ate, but it also took the L on your behalf π
π₯ SEE ALSO π₯
the whole friend group, fr fr π
- Kernel file
./drivers/base/power/runtime.c 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_suspend(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_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)
and that's the whole page, bestie π this one's from ./drivers/base/power, dated October 2026, and the header/footer both say __pm_runtime_set_status(9) β iconic, consistent, we love to see it πβ¨
π¦ 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