[PATCH RFC v2 01/35] spi: spi-mem: Stop checking the dummy buswidth against board wiring
Miquel Raynal
miquel.raynal at bootlin.com
Fri Nov 27 06:22:23 PST 2026
The dummy phase does not transfer any data. Its buswidth only describes
the pin state during the dummy cycles, so it must not be validated
against the board's Tx/Rx wiring.
Drop that check (the sanity check in spi_mem_check_op() stays).
Suggested-by: Pratyush Yadav <pratyush at kernel.org>
Link: https://lore.kernel.org/linux-mtd/20241112075242.174010-1-linchengming884@gmail.com/T/#m7cc1a5055702f5a42a8f3949c968842d845914d7
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
This is not really a fix, so no fixes/cc:stable is on purpose.
---
drivers/spi/spi-mem.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 8047b7508c8d..648982350863 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -152,9 +152,10 @@ static bool spi_mem_check_buswidth(struct spi_mem *mem,
spi_check_buswidth_req(mem, op->addr.buswidth, true))
return false;
- if (op->dummy.nbytes &&
- spi_check_buswidth_req(mem, op->dummy.buswidth, true))
- return false;
+ /*
+ * The dummy phase implies no actual transmission nor reception.
+ * Its buswidth therefore does not matter much.
+ */
if (op->data.dir != SPI_MEM_NO_DATA &&
spi_check_buswidth_req(mem, op->data.buswidth,
--
2.56.0
More information about the linux-riscv
mailing list