Skip to content

Fixes for https://github.com/raspberrypi/linux/issues/7301#7302

Merged
pelwell merged 2 commits intoraspberrypi:rpi-7.0.yfrom
by:rpi-7.0.y
Apr 14, 2026
Merged

Fixes for https://github.com/raspberrypi/linux/issues/7301#7302
pelwell merged 2 commits intoraspberrypi:rpi-7.0.yfrom
by:rpi-7.0.y

Conversation

@by
Copy link
Copy Markdown

@by by commented Apr 3, 2026

These are the two fixes I successfully tested to mitigate #7301

@popcornmix
Copy link
Copy Markdown
Collaborator

Any fixes to code that is unchanged in our downstream (rpi-7.0.y) kernel will need to be submitted upstream.
See here.

@by
Copy link
Copy Markdown
Author

by commented Apr 4, 2026

Thanks, and I'm trying to get this done, but it is not trivial for a non-kernel developer, as it appears; have reached out via email to check.

The two regarding RP1 (6b29188 and 0504cd9) are independent of the others, only for Pis with the RP1 and not related to upstream linux, if I'm not mistaken? I should have created two pull requests, my mistake, I'm sorry.

@popcornmix
Copy link
Copy Markdown
Collaborator

Yes, I think the RP1 commits affect downstream code, so belong here.

The PPS commits looked to be editing files we haven't changed downstream, so belong upstream.
We can pick them up once they are accepted upstream, but the (upstream) code devs are in a better position to judge the changes to be correct (and advise if not).

@by by marked this pull request as draft April 4, 2026 15:41
@nbuchwitz
Copy link
Copy Markdown
Contributor

Thanks, and I'm trying to get this done, but it is not trivial for a non-kernel developer, as it appears; have reached out via email to check.

The two regarding RP1 (6b29188 and 0504cd9) are independent of the others, only for Pis with the RP1 and not related to upstream linux, if I'm not mistaken? I should have created two pull requests, my mistake, I'm sorry.

Regarding the non-rp1 commits:

The pps-gpio threaded IRQ split is clean and nearly ready for upstream as-is. I'd lead the series with that one.

The raw_spinlock conversion needs some rework though. pps_event() calls wake_up_interruptible_all(), kill_fasync(), and the echo callback all under the lock - those can sleep on RT and must not be held under raw_spinlock. You'd need to move those out of the critical section first, then do the conversion. That makes it a 2-3 patch mini-series on its own.

If this is your first touchpoint with the upstream process and you'd like help getting this posted to the mailing list, feel free to reach out - happy to guide you through the process.

@by by marked this pull request as ready for review April 6, 2026 21:08
@by
Copy link
Copy Markdown
Author

by commented Apr 6, 2026

Thank you all! – I reduced to just the two patches re. RP1 here, moved the other (independent!) stuff to upstream discussions.

@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 14, 2026

These changes look OK (and useful), but I'd like them to follow the kernel coding style and have Signed-off-by lines - take a look at the checkpatch failures: https://github.com/raspberrypi/linux/actions/runs/24354711212/job/71118528194?pr=7302

by added 2 commits April 14, 2026 12:02
rp1_irq_set_affinity() delegates to msi_domain_set_affinity() but
does not call irq_data_update_effective_affinity() and does not
return IRQ_SET_MASK_OK_DONE. Without this, the generic IRQ core
never calls irq_set_thread_affinity(), so on PREEMPT_RT the
force-threaded handler remains pinned to its original CPU even
though the hardware interrupt is steered correctly.

This causes PPS timestamps to be captured on a non-isolated CPU,
adding variable latency to precision timing applications.

Fix by updating the effective affinity and returning
IRQ_SET_MASK_OK_DONE on success.

Fixes: raspberrypi#7301

Signed-off-by: Michael Byczkowski <by@by-online.de>
rp1_gpio_irq_set_affinity() delegates to the parent chip but does
not call irq_data_update_effective_affinity() and does not return
IRQ_SET_MASK_OK_DONE. This causes the same PREEMPT_RT thread
affinity problem as in the MFD layer, at the pinctrl level of the
interrupt hierarchy.

Fix by updating the effective affinity and returning
IRQ_SET_MASK_OK_DONE on success.

Fixes: raspberrypi#7301

Signed-off-by: Michael Byczkowski <by@by-online.de>
@by
Copy link
Copy Markdown
Author

by commented Apr 14, 2026

Thank you for your feedback and done.

@pelwell pelwell merged commit 8d5acfe into raspberrypi:rpi-7.0.y Apr 14, 2026
11 of 12 checks passed
@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 14, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants