Re: [PATCH v5 1/3] pps: pps-gpio: split IRQ handler into hardirq and threaded parts

From: Sebastian Andrzej Siewior

Date: Fri May 22 2026 - 10:48:03 EST


On 2026-04-25 19:19:19 [+0200], Michael Byczkowski wrote:
> On PREEMPT_RT, all IRQ handlers are force-threaded. The current
> pps_gpio_irq_handler captures the PPS timestamp via pps_get_ts()
> inside the handler, but on RT this runs in thread context — after
> a scheduling delay that adds variable latency (jitter) to the
> timestamp.
>
> Split the handler into a hardirq primary (pps_gpio_irq_hardirq)
> that only captures the timestamp, and a threaded handler
> (pps_gpio_irq_thread) that processes the event. With
> request_threaded_irq(), the primary handler runs in hardirq context
> even on PREEMPT_RT, preserving nanosecond timestamp precision.
>
> On non-RT kernels, request_threaded_irq with an explicit primary
> handler behaves identically to the previous request_irq call.

No sure if this is wrong wording or so. You end up with a primary
handler in hardirq context and a threaded handler. So have both with and
without PREEMPT_RT.

But the change makes sense.

> 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