Re: [PATCH] coresight: tpda: fix race between refcnt check and register access

From: Suzuki K Poulose

Date: Mon Nov 09 2026 - 06:25:43 EST



On Wed, 08 Apr 2026 21:23:44 +0800, Jie Gan wrote:
> Several sysfs show/store handlers check csdev->refcnt before acquiring
> the spinlock, then access hardware registers inside the lock. This is
> a race: between the check and the lock acquisition, the following can
> occur on another CPU:
>
> CPU 0 (sysfs reader) CPU 1 (disable path)
> ───────────────────────────── ──────────────────────────────────
> refcnt == 1, check passes
> [waiting for spinlock] tpda_disable(): refcnt → 0
> debug clock disabled
> spinlock acquired
> readl_relaxed() ← FAULT/hang
>
> [...]

Applied, thanks!

[1/1] coresight: tpda: fix race between refcnt check and register access
https://git.kernel.org/coresight/c/4f5f1e5ae120

Best regards,
--
Suzuki K Poulose <suzuki.poulose@xxxxxxx>