Fixes for https://github.com/raspberrypi/linux/issues/7301#7302
Fixes for https://github.com/raspberrypi/linux/issues/7301#7302pelwell merged 2 commits intoraspberrypi:rpi-7.0.yfrom
Conversation
|
Any fixes to code that is unchanged in our downstream (rpi-7.0.y) kernel will need to be submitted upstream. |
|
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. |
|
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. |
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. |
|
Thank you all! – I reduced to just the two patches re. RP1 here, moved the other (independent!) stuff to upstream discussions. |
|
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 |
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>
|
Thank you for your feedback and done. |
|
Thanks! |
These are the two fixes I successfully tested to mitigate #7301