openwrt-cghmn-mt300n/target/linux/bcm27xx/patches-6.6/950-1530-spi-dw-Wait-for-idle-after-TX.patch
Álvaro Fernández Rojas 251f76c1c6 bcm27xx: pull 6.6 patches from RPi repo
Adds latest 6.6 patches from the Raspberry Pi repository.

These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.6.y/
With the following command:
git format-patch -N v6.6.83..HEAD
(HEAD -> 08d4e8f52256bd422d8a1f876411603f627d0a82)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-03-16 08:04:48 +01:00

30 lines
787 B
Diff

From 54a442deb925c37346abbbcc566234757925910c 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 | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -304,6 +304,11 @@ static int dw_spi_dma_wait_tx_done(struc
return -EIO;
}
+ if (!xfer->rx_buf) {
+ while (dw_readl(dws, DW_SPI_SR) & DW_SPI_SR_BUSY)
+ cpu_relax();
+ }
+
return 0;
}