Skip to content

hwmon: rp1-adc: fix spinlock leak on errors - #7656

Merged
pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-adc-spinlock
Sep 28, 2026
Merged

pelwell merged 1 commit into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-adc-spinlock

Conversation

@nbuchwitz

Copy link
Copy Markdown
Contributor

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

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
nbuchwitz marked this pull request as ready for review September 28, 2026 12:33
@pelwell
pelwell merged commit 648ac9c into raspberrypi:rpi-6.18.y Sep 28, 2026
12 checks passed
@nbuchwitz
nbuchwitz deleted the devel/rp1-adc-spinlock branch September 28, 2026 15:01
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
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.

2 participants