__pm_stay_awake(9)
π __pm_stay_awake β a Kernel API Manual moment π
okay so bestie, welcome to the Kernel API Manual, page __pm_stay_awake(9). this one's short and sweet but it's literally carrying the whole power-management vibe, so pay attention π«Ά
β¨ NAME β¨
__pm_stay_awake β notify the PM core of a wakeup event. that's it, that's the whole job, and it does it flawlessly π
β¨ SYNOPSIS β¨
void __pm_stay_awake (struct wakeup_source *ws );
look at that signature. void. no return value. no drama. just vibes β¨
β¨ ARGUMENTS β¨
wsβ the wakeup source object that's associated with whatever is out here causing the event. like, the source of the source, ykwim? π
β¨ DESCRIPTION β¨
so here's the tea: it is safe to call this function from interrupt context π₯ no cap. interrupt context is famously not the place you wanna be doing anything cute or extra, but this one? totally fine there. it's giving low-maintenance, unbothered, main character energy π
fr fr, "safe from interrupt context" is the whole entire description here β don't go inventing extra behaviour for it, bestie π
β¨ SEE ALSO β¨
this is the part where the friend group shows up. everyone is here:
Kernel file ./drivers/base/power/wakeup.c β that's where the magic lives π§
wakeup_source_create(9)wakeup_source_destroy(9)wakeup_source_add(9)wakeup_source_remove(9)wakeup_source_register(9)wakeup_source_unregister(9)wakeup_sources_read_lock(9)wakeup_sources_read_unlock(9)wakeup_sources_walk_start(9)wakeup_sources_walk_next(9)device_wakeup_attach(9)device_wakeup_enable(9)device_wakeup_attach_irq(9)device_wakeup_detach_irq(9)device_wakeup_arm_wake_irqs(9)device_wakeup_disarm_wake_irqs(9)device_wakeup_detach(9)device_wakeup_disable(9)device_set_wakeup_capable(9)device_set_wakeup_enable(9)wakeup_source_not_usable(9)wakeup_source_activate(9)wakeup_source_report_event(9)pm_stay_awake(9)wakeup_source_deactivate(9)__pm_relax(9)pm_relax(9)pm_wakeup_timer_fn(9)pm_wakeup_ws_event(9)pm_wakeup_dev_event(9)pm_wakeup_pending(9)pm_get_wakeup_count(9)pm_save_wakeup_count(9)pm_wakep_autosleep_enabled(9)print_wakeup_source_stats(9)wakeup_sources_stats_seq_show(9)bpf_wakeup_sources_read_lock(9)bpf_wakeup_sources_read_unlock(9)bpf_wakeup_sources_get_head(9)
(yes you read pm_wakep_autosleep_enabled(9) correctly β that's the name, we do not touch it, we do not "fix" it, we respect it ππ)
that's the whole page, icon. short, iconic, interrupt-context-safe πΈ
β sign-off: this lil beauty lives in ./drivers/base/power, dated October 2026, and it's part of the Kernel API Manual β go forth and wake things up responsibly, bestie ππ
π¦ 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