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

Wolfram Sang <[email protected]> Mon, 27 Jul 2026 10:03:10 +0200
Newsgroups org.kernel.vger.linux-remoteproc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc
Message-ID <amcQvjpxQHzUNrIx@ninjato>
> 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...