[PATCH 06/13] spi: cadence-qspi: Make sure we filter out unsupported ops

Miquel Raynal (Schneider Electric) posted 13 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 06/13] spi: cadence-qspi: Make sure we filter out unsupported ops
Posted by Miquel Raynal 1 month, 3 weeks ago
The Cadence driver does not support anything else than repeating the
command opcode twice while in octal DTR mode. Make this clear by
checking for this in the ->supports_op() hook.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-cadence-quadspi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 8f78d1c44663..f59f3a8dccf5 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1537,6 +1537,10 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
 			return false;
 		if (op->data.nbytes && op->data.buswidth != 8)
 			return false;
+
+		/* A single opcode is supported, it will be repeated */
+		if ((op->cmd.opcode >> 8) != (op->cmd.opcode & 0xFF))
+			return false;
 	} else if (!all_false) {
 		/* Mixed DTR modes are not supported. */
 		return false;

-- 
2.51.1
Re: [PATCH 06/13] spi: cadence-qspi: Make sure we filter out unsupported ops
Posted by Pratyush Yadav 1 month, 2 weeks ago
On Fri, Dec 19 2025, Miquel Raynal wrote:

> The Cadence driver does not support anything else than repeating the
> command opcode twice while in octal DTR mode. Make this clear by
> checking for this in the ->supports_op() hook.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Pratyush Yadav <pratyush@kernel.org>

[...]

-- 
Regards,
Pratyush Yadav