[PATCH 09/12] spi: mtk-nor: Validate the dummy buswidth
From: Miquel Raynal
Date: Thu Nov 26 2026 - 14:11:49 EST
The driver only supports the dummy phase on the address bus; the
read mode is selected from the address buswidth. Reject operations where
the dummy buswidth differs from the address buswidth.
Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
drivers/spi/spi-mtk-nor.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index 6b6e55d68048..350b47fab7e6 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -317,6 +317,9 @@ static bool mtk_nor_supports_op(struct spi_mem *mem,
if (op->cmd.buswidth != 1)
return false;
+ if (op->dummy.nbytes && op->dummy.buswidth != op->addr.buswidth)
+ return false;
+
if ((op->addr.nbytes == 3) || (op->addr.nbytes == 4)) {
switch (op->data.dir) {
case SPI_MEM_DATA_IN:
--
2.56.0