hwmon: rp1-adc: fix spinlock leak on errors - #7656
Merged
Merged
Conversation
rp1_adc_read() returns with the spinlock held when the ADC is not ready in time or reports a conversion error. The next read then spins on the lock forever with preemption disabled. This also happens when RP1 stops responding on PCIe, since CS then reads as all ones with both READY and ERR set. Fixes: 512bbbd ("hwmon: Add RP1 ADC and temperature driver") Link: raspberrypi#7653 Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
nbuchwitz
marked this pull request as ready for review
September 28, 2026 12:33
pelwell
approved these changes
Sep 28, 2026
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Sep 29, 2026
kernel: ASoC: iqaudio-codec: Add mic-only start-up delay See: raspberrypi/linux#7535 kernel: configs: Enable CONFIG_DRM_PANIC See: raspberrypi/linux#7637 kernel: drm/vc4: fix two phase errors in the HVS scaler, and the chroma siting default See: raspberrypi/linux#7630 kernel: Make the MXL86110 LEDs emulate the BCM54210 See: raspberrypi/linux#7640 kernel: Starvis2 sensor driver support (IMX662) See: raspberrypi/linux#7615 kernel: media: i2c: arducam_64mp: Fix crop sizes for 9152x6944 and 8000x6000 See: raspberrypi/linux#7652 kernel: hwmon: rp1-adc: fix spinlock leak on errors See: raspberrypi/linux#7656 kernel: media: sony-starvis2: Correct the minimum exposure See: raspberrypi/linux#7658 kernel: overlays: i2c-rtc: Add quartz-load-femtofarads See: raspberrypi/linux#7660 kernel: dmaengine: dw-axi-dmac: Add channel abort support See: raspberrypi/linux#7654
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Sep 29, 2026
kernel: ASoC: iqaudio-codec: Add mic-only start-up delay See: raspberrypi/linux#7535 kernel: configs: Enable CONFIG_DRM_PANIC See: raspberrypi/linux#7637 kernel: drm/vc4: fix two phase errors in the HVS scaler, and the chroma siting default See: raspberrypi/linux#7630 kernel: Make the MXL86110 LEDs emulate the BCM54210 See: raspberrypi/linux#7640 kernel: Starvis2 sensor driver support (IMX662) See: raspberrypi/linux#7615 kernel: media: i2c: arducam_64mp: Fix crop sizes for 9152x6944 and 8000x6000 See: raspberrypi/linux#7652 kernel: hwmon: rp1-adc: fix spinlock leak on errors See: raspberrypi/linux#7656 kernel: media: sony-starvis2: Correct the minimum exposure See: raspberrypi/linux#7658 kernel: overlays: i2c-rtc: Add quartz-load-femtofarads See: raspberrypi/linux#7660 kernel: dmaengine: dw-axi-dmac: Add channel abort support See: raspberrypi/linux#7654
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rp1_adc_read() returns with the spinlock held when the ADC is not ready in time or reports a conversion error. The next read then spins on the lock forever with preemption disabled.
This also happens when RP1 stops responding on PCIe, since CS then reads as all ones with both READY and ERR set.
Fixes: 512bbbd ("hwmon: Add RP1 ADC and temperature driver")
Link: #7653