hwspin_trylock_irqsave(9)
π hwspin_trylock_irqsave(9) π
okay bestie, welcome to the hwspin_trylock_irqsave(9) page from the Kernel API Manual β¨ this one is short, iconic, and very βtry it, donβt wait aroundβ energy.
πΈ NAME πΈ
hwspin_trylock_irqsave β try to lock an hwspinlock, disable interrupts π
π¦ SYNOPSIS π¦
int hwspin_trylock_irqsave (struct hwspinlock *hwlock , unsigned long
*flags );
π ARGUMENTS π
hwlockβ an hwspinlock which we want to trylock πflagsβ a pointer to where the caller's interrupt state will be saved at πΎ
π₯ DESCRIPTION π₯
This function attempts to lock the underlying hwspinlock, and will immediately fail if the hwspinlock is already locked. No waiting around, no drama, just instant βnopeβ energy π
Upon a successful return from this function, preemption and local interrupts are disabled (previous interrupts state is saved at flags), so the caller must not sleep, and is advised to release the hwspinlock as soon as possible. That part is important, bestie β do not sleep here, and let that lock go ASAP π«Ά
Returns0if we successfully locked the hwspinlock,-EBUSYif the hwspinlock was already taken, and-EINVALifhwlockis invalid. Periodt. π
π SEE ALSO π
Kernel file ./include/linux/hwspinlock.h β plus the whole hwspinlock friend group:
hwspin_trylock_irq(9)hwspin_trylock_raw(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)
mwah π this page lives under ./include/linux, dated October 2026, and itβs all about hwspin_trylock_irqsave(9). slay and stay locked β or at least try to β¨
π¦ 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