pm_runtime_get_conditional(9)
π pm_runtime_get_conditional(9) π
okay so bestie, welcome to the pm_runtime_get_conditional(9) page from the Kernel API Manual π«Άβ¨ This one is lowkey all about conditionally bumping a deviceβs usage counter, and the way that one tiny counter controls suspend vibes is honestly iconic π
πΈ NAME πΈ
pm_runtime_get_conditional β Conditionally bump up device usage counter. π
β¨ SYNOPSIS β¨
int pm_runtime_get_conditional (struct device *dev , bool
ign_usage_count );
π ARGUMENTS π
devβ Device to handle. π«Άign_usage_countβ Whether or not to look at the current usage counter value. π
π¦ DESCRIPTION π¦
If runtime PM is disabled for dev, it returns -EINVAL β yes, thatβs the vibe-check fail ππ
Otherwise, if its runtime PM status is RPM_ACTIVE and any one of these is true:
ign_usage_countis set.devis not ignoring children and its active child count is nonzero.- the runtime PM usage counter of
devis not zero.
then it increments the usage counter of dev and returns 1 π₯ periodt π
Otherwise, it returns 0 and does not change the usage counter. no cap πβ¨
If ign_usage_count is true, this function can be used to prevent suspending the device when its runtime PM status is RPM_ACTIVE. π
If ign_usage_count is false, this function can be used to prevent suspending the device when both its runtime PM status is RPM_ACTIVE and its runtime PM usage counter is not zero. π¦
bestie, this part is literally important: the caller is responsible for decrementing the runtime PM usage counter of dev after this function has returned a positive value for it. not optional, fr fr π«Ά
π SEE ALSO π
okay the cross-ref list is long but we are not skipping a single one, iykyk πβ¨
- 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_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)
Catch you later, bestie π β this oneβs filed under source/version ./drivers/base/power, dated October 2026, and signed pm_runtime_get_conditional(9) from 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