summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikhail Kshevetskiy <[email protected]>2025-11-09 10:06:50 +0300
committerMichael Trimarchi <[email protected]>2025-11-18 20:07:41 +0100
commit8bd05b632a64673f43ea3368612fa7123a128e17 (patch)
tree5cf9f738f4edb17efa88a2fc69ab19c2b7a96375 /drivers
parenta7c3319bc007469554df8acbace3d41442229fe5 (diff)
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 <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/airoha_snfi_spi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/airoha_snfi_spi.c b/drivers/spi/airoha_snfi_spi.c
index f72d11f5b19..bec4ec0bf00 100644
--- a/drivers/spi/airoha_snfi_spi.c
+++ b/drivers/spi/airoha_snfi_spi.c
@@ -630,6 +630,10 @@ static int airoha_snand_dirmap_create(struct spi_mem_dirmap_desc *desc)
if (desc->info.offset + desc->info.length > U32_MAX)
return -EINVAL;
+ /* continuous reading is not supported */
+ if (desc->info.length > SPI_NAND_CACHE_SIZE)
+ return -E2BIG;
+
if (!airoha_snand_supports_op(desc->slave, &desc->info.op_tmpl))
return -EOPNOTSUPP;