Skip to content

Commit 171f8a4

Browse files
TobleMinerbroonie
authored andcommitted
spi: sun6i: reduce DMA RX transfer width to single byte
Through empirical testing it has been determined that sometimes RX SPI transfers with DMA enabled return corrupted data. This is down to single or even multiple bytes lost during DMA transfer from SPI peripheral to memory. It seems the RX FIFO within the SPI peripheral can become confused when performing bus read accesses wider than a single byte to it during an active SPI transfer. This patch reduces the width of individual DMA read accesses to the RX FIFO to a single byte to mitigate that issue. Signed-off-by: Tobias Schramm <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2dde18c commit 171f8a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-sun6i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int sun6i_spi_prepare_dma(struct sun6i_spi *sspi,
207207
struct dma_slave_config rxconf = {
208208
.direction = DMA_DEV_TO_MEM,
209209
.src_addr = sspi->dma_addr_rx,
210-
.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
210+
.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
211211
.src_maxburst = 8,
212212
};
213213

0 commit comments

Comments
 (0)