hwspin_trylock_raw(9)
π hwspin_trylock_raw(9) π
Okay so bestie, this whole page is literally about hwspin_trylock_raw(9) β it's the "try it, don't wait" raw hwspinlock function, and it's giving main character energy in the kernel API manual. Let's get into it π
β¨ NAME β¨
hwspin_trylock_raw β attempt to lock a specific hwspinlock
πΈ SYNOPSIS πΈ
int hwspin_trylock_raw (struct hwspinlock *hwlock );
π¦ ARGUMENTS π¦
hwlockβ an hwspinlock which we want to trylock (yes, that's the whole vibe β it's the lock you're trying to snag π
π DESCRIPTION π
This function attempts to lock an hwspinlock, and will immediately fail if the hwspinlock is already taken. No waiting around, no "let me just see if it frees up" β it's an instant yes or no, and honestly? Iconic.
π¨ Caution: User must protect the routine of getting hardware lock with mutex or spinlock to avoid dead-lock, that will let user can do some time-consuming or sleepable operations under the hardware lock. π¨
Returns 0 if we successfully locked the hwspinlock, -EBUSY if the hwspinlock was already taken, and -EINVAL if hwlock is invalid. Periodt.
π SEE ALSO π
The kernel file is ./include/linux/hwspinlock.h and it's besties with:
hwspin_trylock_irqsave(9)hwspin_trylock_irq(9)hwspin_trylock_in_atomic(9)hwspin_trylock(9)hwspin_lock_timeout_irqsave(9)hwspin_lock_timeout_irq(9)hwspin_lock_timeout_raw(9)hwspin_lock_timeout_in_atomic(9)hwspin_lock_timeout(9)hwspin_unlock_irqrestore(9)hwspin_unlock_irq(9)hwspin_unlock_raw(9)hwspin_unlock_in_atomic(9)hwspin_unlock(9)
And that's the page, bestie π«Ά source/version is ./include/linux, dated October 2026, and the manual name is still hwspin_trylock_raw(9) β 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