[PATCH 01/12] spi: amd: Validate the dummy buswidth

From: Miquel Raynal

Date: Thu Nov 26 2026 - 14:11:07 EST


The driver clocks the dummy phase with the data buswidth. Reject
operations asking for a different dummy buswidth.

Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
drivers/spi/spi-amd.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index d3953de255be..0c56d5b2a6db 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -459,6 +459,9 @@ static bool amd_spi_supports_op(struct spi_mem *mem,
if (op->cmd.buswidth > 1 || op->addr.buswidth > 4)
return false;

+ if (op->dummy.nbytes && op->dummy.buswidth != op->data.buswidth)
+ return false;
+
/* AMD SPI controllers support quad mode only for read operations */
if (amd_is_spi_read_cmd(op->cmd.opcode) || amd_is_spi_write_cmd(op->cmd.opcode)) {
if (op->data.buswidth > 4)

--
2.56.0