__hwspin_unlock(9)
π
__hwspin_unlock(9) β kernel API manual, but make it make sense
okay bestie, welcome to the __hwspin_unlock(9) page πΈ this one lives in the Kernel API Manual and it's literally the "let go of the lock" girlie. she's short, she's sweet, she does not sleep, periodt.
β¨ NAME β¨
__hwspin_unlock β unlock a specific hwspinlock π
π¦ SYNOPSIS π¦
void __hwspin_unlock (struct hwspinlock *hwlock , int mode , unsigned
long *flags );
π ARGUMENTS π
hwlockβ the hwspinlock you already grabbed earlier and now want to hand back, no cap π«Άmodeβ this one decides whether local interrupts need to be restored or not β it's the vibe check for your interrupt state β¨flagsβ the caller's previous interrupt state, there to be restored (if you asked for that, that is) π§
π DESCRIPTION π
So here's the tea β β this function will unlock a specific hwspinlock, enable preemption, and (possibly) enable interrupts or restore their previous state. the whole package π
β οΈ hwlock must be already locked before you call this. calling unlock on a hwlock that is already unlocked is a bug β not a quirky lil accident, an actual bug π
the user is the one who decides whether local interrupts should be enabled or not, and if yes, whether they want their previous state restored. it's 100% up to you to pick the appropriate mode of operation β and it works exactly the same way users decide between spin_unlock, spin_unlock_irq and spin_unlock_irqrestore. same energy, different lock π
and the best part: the function will never sleep π΄π« she stays awake, she stays iconic.
π₯ SEE ALSO π₯
Kernel file ./drivers/hwspinlock/hwspinlock_core.c, plus the whole friend group:
__hwspin_trylock(9)__hwspin_lock_timeout(9)hwspin_lock_bust(9)of_hwspin_lock_simple_xlate(9)of_hwspin_lock_get_id(9)of_hwspin_lock_get_id_byname(9)hwspin_lock_register(9)hwspin_lock_unregister(9)devm_hwspin_lock_unregister(9)devm_hwspin_lock_register(9)__hwspin_lock_request(9)hwspin_lock_request_specific(9)hwspin_lock_free(9)devm_hwspin_lock_free(9)devm_hwspin_lock_request_specific(9)
and that's the page, bestie π«Ά this lil drop came from ./drivers/hwspinlock, dated October 2026 β catch you on the next man page, 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