__hwspin_unlock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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:


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