spi: spidev: Align buffers for DMA
commit7ebb8fd40256e4b661b5d3a38fbbf4c404205fc5
authorChristian Eggers <ceggers@arri.de>
Tue, 28 Jul 2020 10:08:32 +0000 (28 12:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:16:25 +0000 (19 08:16 +0200)
tree88d7bb4d71c6ff9214361aee16fdd65856be6dff
parente02c77edd9b015ab49d3ac882c9dd70103a8151b
spi: spidev: Align buffers for DMA

commit aa9e862d7d5bcecd4dca9f39e8b684b93dd84ee7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spidev.c