spi: dw-dma: Get the last DMA scoop out of the FIFO
authorPhil Elwell <phil@raspberrypi.com>
Tue, 7 Nov 2023 14:49:47 +0000 (14:49 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:12 +0000 (11:35 +0000)
commit1d87b098e9455ba01d97ef164b73b48edc64c399
treefea6151815c6eea05ea205d5c0b17a91f991fc7f
parentc2d096ec2bd55acd222ee169463a38dea0f3a0e4
spi: dw-dma: Get the last DMA scoop out of the FIFO

With a DMA FIFO threshold greater than 1 (encoded as 0), it is possible
for data in the FIFO to be inaccessible, causing the transfer to fail
after a timeout. If the transfer includes a transmission, reduce the
RX threshold when the TX completes, otherwise use 1 for the whole
transfer (inefficient, but not catastrophic at SPI data rates).

See: https://github.com/raspberrypi/linux/issues/5696

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/spi/spi-dw-dma.c