spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch
authorVignesh R <vigneshr@ti.com>
Tue, 15 Jan 2019 06:58:32 +0000 (12:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 17:29:02 +0000 (18:29 +0100)
commitcb92a5c2cd39cad6992c9741dcb7908bb3d2e074
treedd6c1c74987509ebf9de769301383e58ae183a01
parent61022359b32f21654c9d53216a5c5f0723fbf6e7
spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch

[ Upstream commit baf8b9f8d260c55a86405f70a384c29cda888476 ]

Commit b682cffa3ac6 ("spi: omap2-mcspi: Set FIFO DMA trigger level to word length")
broke SPI transfers where bits_per_word != 8. This is because of
mimsatch between McSPI FIFO level event trigger size (SPI word length) and
DMA request size(word length * maxburst). This leads to data
corruption, lockup and errors like:

spi1.0: EOW timed out

Fix this by setting DMA maxburst size to 1 so that
McSPI FIFO level event trigger size matches DMA request size.

Fixes: b682cffa3ac6 ("spi: omap2-mcspi: Set FIFO DMA trigger level to word length")
Cc: stable@vger.kernel.org
Reported-by: David Lechner <david@lechnology.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-omap2-mcspi.c