Re: [PATCH v5 0/3] pps: improve PREEMPT_RT performance

From: Michael Byczkowski

Date: Fri May 22 2026 - 12:01:07 EST


Dear Calvin,

Thanks for picking this up, and yes, I’m actually a bit overwhelmed, so your help is much appreciated! And my apologies for the delay, I was traveling.

The clean v5 series is at:
https://github.com/by/linux-PPS/tree/pps-rt-v5-clean

Three commits on top of torvalds 0d9363a764d9 (around v7.0-rc6):
pps: pps-gpio: split IRQ handler into hardirq timestamper + threaded handler pps: convert pps_device.lock to raw_spinlock_t pps: kc: convert pps_kc_hardpps_lock to raw_spinlock_t

Your suspicion about Apple Mail was correct: I diffed the GitHub branch against the lore mbox and the sent version has quoted-printable damage which would explain why nobody could git am it cleanly. The GitHub branch is the ground truth.

Let me know how you'd like to proceed.
Lore thread for context: https://lore.kernel.org/lkml/719A31CE-CA58-45C3-A013-1BFE81F724C5@xxxxxxxxxxxx/

Thanks and best regards,
Michael


> On 19. May 2026, at 18:19, Calvin Owens <calvin@xxxxxxxxxx> wrote:
>
> On Saturday 05/16 at 13:32 +0200, Michael Byczkowski wrote:
>>> On 25. Apr 2026, at 19:18, Michael Byczkowski <by@xxxxxxxxxxxx> wrote:
>>>
>>> I found three issues in the PPS subsystem that cause unnecessary jitter
>>> under PREEMPT_RT, while being fully backward-compatible with non-RT
>>> kernels:
>>>
>>> 1. pps-gpio: The IRQ handler is force-threaded on PREEMPT_RT, so the
>>> PPS timestamp is captured after scheduling delay rather than at
>>> interrupt entry. Fix: split into a hardirq primary handler (captures
>>> timestamp only) and a threaded handler (processes the event).
>>>
>>> 2. pps_device.lock: spinlock_t becomes a sleeping mutex on PREEMPT_RT,
>>> allowing pps_event() to be preempted mid-update. Fix: convert to
>>> raw_spinlock_t and move sleeping calls out of the critical section.
>>>
>>> 3. pps_kc_hardpps_lock: Same issue as (2), in the kernel consumer path
>>> that calls hardpps(). Fix: convert to DEFINE_RAW_SPINLOCK.
>>>
>>> All three patches are tested on a Raspberry Pi 5 running a 7.0.0-rc6
>>> PREEMPT_RT kernel. On non-RT kernels there is zero behavioral change.
>>>
>>> Signed-off-by: Michael Byczkowski <by@xxxxxxxxxxxx>
>>> Acked-by: Rodolfo Giometti <giometti@xxxxxxxxxxxx>
>>> Tested-by: Michael Byczkowski <by@xxxxxxxxxxxx>
>>>
>>> by (3):
>>> pps: pps-gpio: split IRQ handler into hardirq and threaded parts
>>> pps: convert pps_device lock to raw_spinlock for PREEMPT_RT
>>> pps: convert pps_kc_hardpps_lock to raw_spinlock for PREEMPT_RT
>>>
>>> drivers/pps/clients/pps-gpio.c | 37 +++++++++++++++++++++++-----------
>>> drivers/pps/kapi.c | 18 ++++++++++-------
>>> drivers/pps/kc.c | 22 ++++++++++----------
>>> drivers/pps/pps.c | 16 +++++++--------
>>> include/linux/pps_kernel.h | 2 +-
>>> 5 files changed, 56 insertions(+), 39 deletions(-)
>>>
>>> --
>>> 2.47.3
>>
>> Gentle ping on this series. v4 patches 1/3 and 3/3 carried Rodolfo's
>> Acked-by; v5 addressed the remaining feedback on 2/3. Happy to rework
>> anything or split the series if that helps it move forward.
>
> Unfortunately apple mail is corrupting your patches :/
>
> Greg KH usually applies patches for drivers/pps/, but I didn't add him
> here yet because the patches don't apply.
>
> If you can point me at a git branch for v5, I'd be happy to re-send the
> patches myself with your authorship. This is all useful for me and I'd
> like to help :)
>
> If you do it yourself, just make sure to add Greg to the Cc: list.
>
> Cheers,
> Calvin
>
>> Adding linux-rt-users@ and Sebastian on Cc in case there's interest from the
>> PREEMPT_RT side.