[PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring

From: Miquel Raynal

Date: Wed Nov 25 2026 - 12:52:14 EST


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@xxxxxxxxxx>
Link: https://lore.kernel.org/linux-mtd/20241112075242.174010-1-linchengming884@xxxxxxxxx/T/#m7cc1a5055702f5a42a8f3949c968842d845914d7
Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
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 c64e906ba919..9b8b8f2b3387 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