Skip to content

staging: iio: ad7816: Fix DMA from stack and race conditions

Abdelnasser Hussein linux-iio lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 5 repliesIn review
  2. v22 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Fixed a formatting issue in the v2 cover letter that caused it to be sent empty. No code changes.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2staging: greybus: audio_codec: fix sscanf return value checkdrivers/staging/greybus/audio_codec.c+1 -21 reply
1/2staging: iio: ad7816: serialize ad7816_spi_read() with a mutexdrivers/staging/iio/adc/ad7816.c+8 -22 replies
2/2staging: greybus: audio_codec: remove redundant else-if checkdrivers/staging/greybus/audio_codec.c+1 -10 replies
2/2staging: iio: ad7816: avoid DMA from stack in spi_readdrivers/staging/iio/adc/ad7816.c+3 -32 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] staging: iio: ad7816: Fix DMA from stack and race conditions

This patch series addresses two issues in the ad7816 driver:
1. Adds a mutex to prevent race conditions during SPI reads.
2. Moves the DMA buffer from the stack to the device structure and aligns it properly using IIO_DMA_MINALIGN.

Changes in v3:
- Fixed a formatting issue in the v2 cover letter that caused it to be sent empty. No code changes.

Changes in v2:
- Added a mutex to protect the SPI read sequence.
- Used __aligned(IIO_DMA_MINALIGN) for the DMA buffer.
- Corrected the sizeof() argument in spi_read().
- Added the missing Fixes: tag.

Abdelnasser Hussein (2):
staging: iio: ad7816: serialize ad7816_spi_read() with a mutex
staging: iio: ad7816: avoid DMA from stack in spi_read

 drivers/staging/iio/adc/ad7816.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.54.0