Re: [PATCH v5 3/3] pps: convert pps_kc_hardpps_lock to raw_spinlock for PREEMPT_RT
From: Sebastian Andrzej Siewior
Date: Fri May 22 2026 - 11:28:49 EST
On 2026-04-25 19:21:14 [+0200], Michael Byczkowski wrote:
> Convert pps_kc_hardpps_lock from spinlock_t to raw_spinlock_t. This
> lock is held in pps_kc_event() which calls hardpps(). hardpps() takes
> tk_core.lock which is already a raw_spinlock — nesting a sleeping lock
> (PREEMPT_RT spinlock_t) over a raw_spinlock is invalid.
>
> The locked section only checks a pointer comparison and calls
> hardpps(), both of which are non-sleeping.
>
> On non-RT kernels, raw_spinlock_t compiles to identical code as
> spinlock_t — no behavioral change.
This looks okay. You need to swap patch #2 and #3 - this needs to come
first.
The bracket placement is terrible in pps_kc_bind(). Maybe if you swap to
guard() it becomes readable as a side effect.
> Signed-off-by: Michael Byczkowski <by@xxxxxxxxxxxx>
> Acked-by: Rodolfo Giometti <giometti@xxxxxxxxxxxx>
> Tested-by: Michael Byczkowski <by@xxxxxxxxxxxx>
> Tested-by: Calvin Owens <calvin@xxxxxxxxxx>
Sebastian