[PATCH v5 0/2] staging: iio: adc: ad7816: Fix SPI read race condition and DMA safety

From: Abdelnasser Hussein

Date: Fri Sep 11 2026 - 07:14:21 EST


This series addresses two separate issues in the ad7816 driver:
1. A race condition during SPI reads where multiple threads could
disrupt the GPIO state.
2. A DMA safety issue caused by using a stack-allocated buffer for
SPI transfers.

Changes in v5:
- Split the changes into two separate patches for bisectability, as
requested by reviewers.
- Patch 1 focuses only on serializing the SPI read operations using
guard(mutex) and devm_mutex_init().
- Patch 2 focuses only on replacing the stack buffer with a dedicated
rx_buf aligned with IIO_DMA_MINALIGN.
- Updated commit messages to better describe the architectural issues.

Abdelnasser Hussein (2):
staging: iio: adc: ad7816: Serialize SPI read operations
staging: iio: adc: ad7816: Use DMA-safe buffer for SPI read

drivers/staging/iio/adc/ad7816.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)

--
2.54.0