Re: [PATCH v5 3/3] hwspinlock: add low level debug capabilities

From: Wolfram Sang

Date: Mon Jul 27 2026 - 04:04:04 EST



> However, hwspin_lock_request_specific() takes an unsigned int, which
> will truncate the value.

True. XArray uses ulong, but hwspinlocks are actually uint. I'll replace
the ULONG_MAX with UINT_MAX.

> > + ret = hwspin_trylock(hwlock);
> > + if (ret != -EBUSY) {
>
> [Severity: Medium]
> Does this actually test the hardware lock exclusion?
>
> hwspin_trylock() internally invokes spin_trylock() to acquire a local CPU
> software lock. On the second call, the local software spinlock will fail and
> immediately return -EBUSY without ever testing the actual hardware lock
> operations (like hwlock->bank->ops->trylock()).

Bummer, I was quite sure to have used hwspin_trylock_raw already here.
Seems to have fallen through the cracks.

v6 on the way...