[PATCH RFC v2 11/35] spi: atmel-quadspi: Reject excessive dummy cycle counts
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Nov 27 06:47:54 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] spi: atmel-quadspi: broken dummy buswidth check in
atmel_qspi_supports_op()
--
commit 841dc168dae61bbe3593e703339f362587a598fd
Author: Miquel Raynal <miquel.raynal at bootlin.com>
spi: atmel-quadspi: Reject excessive dummy cycle counts
This commit adds checks to atmel_qspi_supports_op() to reject operations
whose dummy cycle count exceeds QSPI_IFR_NBDUM_MASK or whose dummy
buswidth differs from the address buswidth.
> diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
> index abca99b32b619..8946abaafa81b 100644
> --- a/drivers/spi/atmel-quadspi.c
> +++ b/drivers/spi/atmel-quadspi.c
> @@ -487,9 +487,15 @@ static bool atmel_qspi_supports_op(struct spi_mem *mem,
> if (!spi_mem_default_supports_op(mem, op))
> return false;
>
> + if (op->dummy.ncycles && op->dummy.buswidth != op->addr.buswidth)
> + return false;
[Severity: High]
Does this reject every operation that has dummy cycles but no address
phase?
When op->addr.nbytes is 0, op->addr.buswidth is 0 (for example, in
spi_nor_spimem_setup_op() when micron_st_nor_octal_dtr_en() issues an
8D-8D-8D Read ID with 0 address bytes and 8 dummy bytes, or in SPI NAND
operations using SPI_MEM_OP_NO_ADDR with dummy bytes), so comparing
op->dummy.buswidth against op->addr.buswidth without checking
op->addr.nbytes causes atmel_qspi_supports_op() to return false and fails
those operations with -EOPNOTSUPP.
Also, this buswidth check is not mentioned in the commit message.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-macronix-upstreaming-spi-mem-cycles-v2-0-5c93f5e5d630@bootlin.com?part=11
More information about the linux-mtd
mailing list