Re: [PATCH v4 2/2] PCI/aer_inject: Convert inject_lock to raw_spinlock_t
From: Peter Zijlstra
Date: Mon Nov 03 2025 - 15:29:28 EST
On Mon, Nov 03, 2025 at 09:02:53PM +0100, Sebastian Andrzej Siewior wrote:
> On 2025-11-03 20:21:20 [+0100], Peter Zijlstra wrote:
> > On Sun, Nov 02, 2025 at 10:57:06AM +0000, Guangbo Cui wrote:
> > > The AER injection path may run in interrupt-disabled context while
> > > holding inject_lock. On PREEMPT_RT kernels, spinlock_t becomes a
> > > sleeping lock, so it must not be taken while a raw_spinlock_t is held.
> > > Doing so violates lock ordering rules and trigger lockdep reports
> > > such as “Invalid wait context”.
> > >
> > > Convert inject_lock to raw_spinlock_t to ensure non-sleeping locking
> > > semantics. The protected list is bounded and used only for debugging,
> > > so raw locking will not cause latency issues.
> >
> > Bounded how?
>
> I think I used the term "not bounded" and said "it does not matter
> because it is debugging only". Best would be to leave that part and use
> only "only for debugging".
Yes, that is clearer. Thanks!