pm_stay_awake(9)
π¦ pm_stay_awake β a little kernel API manual moment, bestie
okay so this is a page from the Kernel API Manual (section 9, the pm_stay_awake(9) one) and it's honestly kind of a small page but it's important, so let's get into it π
π NAME
pm_stay_awake β notify the PM core that a wakeup event is being processed.
like, that's it, that's the whole job. but it's a big job, ok π
β¨ SYNOPSIS
void pm_stay_awake (struct device *dev );
π ARGUMENTS
devβ the device that the wakeup event is related to. this is your main character device. the one the whole event is about π«Ά
πΈ DESCRIPTION
so here's the vibe: you call this to notify the PM core of a wakeup event (signaled by dev) β and it does that by calling __pm_stay_awake for dev's wakeup source object. that's the whole mechanism, no extra steps, no cap β¨
call this function after detecting a wakeup event, if pm_relax is going to be called directly after processing the event (and possibly passing it to user space for further processing). that's the specific situation this is for β pm_stay_awake now, pm_relax right after you're done. it's giving matched set, it's giving bookends π₯
ngl the ordering matters here β detect the event first, then call this, and pm_relax follows once the event is processed. don't skip steps, bestie π
π SEE ALSO
ok this list is long but it ate, every single one of these is a friend of this page:
Kernel file ./drivers/base/power/wakeup.cwakeup_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)
and that's the page!! π§ sign-off time: this one lives under ./drivers/base/power, dated October 2026, and it's filed as pm_stay_awake(9) in the Kernel API Manual. go keep those wakeup sources awake, bestie, you got this πβ
π¦ 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