blk_pre_runtime_suspend(9)
π blk_pre_runtime_suspend β Pre runtime suspend check π
okay bestie, so this is a page from the Kernel API Manual β yes, the kernel API manual β and we're talking about blk_pre_runtime_suspend. Buckle up, it's a short one but it's lowkey iconic.
β¨ SYNOPSIS β¨
int blk_pre_runtime_suspend (struct request_queue *q );
like, that's the whole signature. cute. take it in. π
πΈ ARGUMENTS πΈ
qβ the queue of the device. that's it. that's the argument. she's the queue of the device and she's doing main character energy in this whole function, ngl.
π¦ DESCRIPTION π¦
so what does she do? okay so β this function checks whether runtime suspend is even allowed for the device, and she does it by looking at whether there are any requests pending in the queue. that's the whole vibe check. π
If there are requests pending β nope, sorry, the device can not be runtime suspended. not today. but if there aren't any pending requests? then the queue's status gets updated to SUSPENDING and the driver can go ahead and proceed to suspend the device. slay. π
now for the not allowed case β the messy one β we mark last busy for the device, so that the runtime PM core will try to autosuspend it some time later. it's giving "not right now but maybe later bestie." π«Ά
β¨ important vibe note: this function should be called near the start of the device's runtime_suspend callback. like, first thing. don't be late to this one, fr fr.
β RETURN β
0β OK to runtime suspend the device β¨-EBUSYβ Device should not be runtime suspended π
π₯ SEE ALSO π₯
- Kernel file
./block/blk-pm.cβ she's the source file, go look at her blk_pm_runtime_init(9)blk_post_runtime_suspend(9)blk_pre_runtime_resume(9)blk_post_runtime_resume(9)
like, the whole runtime PM friend group. iykyk. π
and that's the page, bestie! π§ this little gem lives in the ./block section of the source, and the version you're looking at is dated October 2026 β so like, future vibes only. go forth and check your queues before you suspend. no cap. ππΈπ
π¦ 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