usb_autopm_p...erface_async(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… usb_autopm_put_interface_async β€” a little field guide πŸ¦‹

okay so bestie, welcome to the Kernel API Manual ✨ β€” yes we're reading kernel docs for fun now, that's the vibe, main character energy fr fr. today's episode: one tiny function that handles your USB interface's power-management counter, but make it async πŸŽ€


🌸 NAME 🌸

usb_autopm_put_interface_async β€” decrement a USB interface's PM-usage counter πŸ’–

like literally, that's the whole job. counter goes down. no cap.


✨ SYNOPSIS ✨

void usb_autopm_put_interface_async (struct usb_interface *intf );

that's it. that's the signature. she returns void, she takes one pointer, she's iconic πŸ’…


🫢 ARGUMENTS 🫢

  • intf β€” the usb_interface whose counter should be decremented. that's your girl right there, the one whose usage counter is about to go down πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so this routine does much the same thing as usb_autopm_put_interface β€” like, spiritually, they're sisters πŸ‘― it decrements intf's usage counter and schedules a delayed autosuspend request if the counter is <= 0 ⭐

but here's the plot twist, the difference, the thing that makes her special: she does not perform any synchronization 😭 callers should hold a private lock and handle all synchronization issues themselves. that's on you, bestie. she is not doing it for you. she has other things going on πŸ™ˆ

typically a driver would call this routine during an URB's completion handler, if no more URBs were pending. yep, that's the moment. that's her moment πŸ”₯

and good news, because this routine can run in atomic context πŸ‘‘ which is honestly a slay β€” no sleeping, no blocking, just vibes.


🌈 SEE ALSO 🌈

kernel file: ./drivers/usb/core/driver.c β€” and the whole friend group, in order, all of them, no skipping:


and that's the whole page babes 🫢 sourced straight from ./drivers/usb/core , dated October 2026 β€” go forth, decrement responsibly, hold that private lock, and remember: she can run in atomic context but she cannot save you from your own missing lock bestie πŸ’€βœ¨

πŸ“¦ where this page comes from