]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spidev: Align buffers for DMA
authorChristian Eggers <ceggers@arri.de>
Tue, 28 Jul 2020 10:08:32 +0000 (12:08 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 28 Jul 2020 16:29:28 +0000 (17:29 +0100)
commita1e88a7631027c0f60b40333c064eb5c07c508fa
treef6ac53356e4ffef387e1ad1e94889b0ef2106e9f
parentabf6d91c9ea3414e5b784c3d0e0ea500384e31a1
spi: spidev: Align buffers for DMA

Simply copying all xfers from userspace into one bounce buffer causes
alignment problems if the SPI controller uses DMA.

Ensure that all transfer data blocks within the rx and tx bounce buffers
are aligned for DMA (according to ARCH_KMALLOC_MINALIGN).

Alignment may increase the usage of the bounce buffers. In some cases,
the buffers may need to be increased using the "bufsiz" module
parameter.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200728100832.24788-1-ceggers@arri.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spidev.c