Skip to content

Commit 4314ffc

Browse files
mkshevetskiybroonie
authored andcommitted
spi: airoha: return an error for continuous mode dirmap creation cases
This driver can accelerate single page operations only, thus continuous reading mode should not be used. Continuous reading will use sizes up to the size of one erase block. This size is much larger than the size of single flash page. Use this difference to identify continuous reading and return an error. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Fixes: a403997 ("spi: airoha: add SPI-NAND Flash controller driver") Link: https://patch.msgid.link/20251012121707.2296160-2-mikhail.kshevetskiy@iopsys.eu Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 760951d commit 4314ffc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/spi/spi-airoha-snfi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,10 @@ static int airoha_snand_dirmap_create(struct spi_mem_dirmap_desc *desc)
618618
if (desc->info.offset + desc->info.length > U32_MAX)
619619
return -EINVAL;
620620

621+
/* continuous reading is not supported */
622+
if (desc->info.length > SPI_NAND_CACHE_SIZE)
623+
return -E2BIG;
624+
621625
if (!airoha_snand_supports_op(desc->mem, &desc->info.op_tmpl))
622626
return -EOPNOTSUPP;
623627

0 commit comments

Comments
 (0)