difos/target/linux/bcm27xx/patches-6.12/950-0790-spi-dw-Wait-for-idle-after-TX.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

30 lines
852 B
Diff

From 832a0cefbdbb8c78f3779cefb315d17ea8e9ad1b Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 3 Feb 2025 17:50:20 +0000
Subject: [PATCH] spi: dw: Wait for idle after TX
If this is a DMA transfer, and if there is no simultaneous RX transfer,
wait for the interface to go idle before reporting that TX is done.
Link: https://forums.raspberrypi.com/viewtopic.php?t=383027
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/spi/spi-dw-dma.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -304,6 +304,12 @@ static int dw_spi_dma_wait_tx_done(struc
return -EIO;
}
+ if (!xfer->rx_buf) {
+ delay.value = dws->n_bytes * BITS_PER_BYTE;
+ while (dw_readl(dws, DW_SPI_SR) & DW_SPI_SR_BUSY)
+ spi_delay_exec(&delay, xfer);
+ }
+
return 0;
}