diff options
| author | Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> | 2025-10-12 15:16:52 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-29 14:08:58 +0100 |
| commit | f5dc5baa5b04ceb0fca2460bc2863921f0e7ede5 (patch) | |
| tree | ec2965696da0451c1cb93fcbd139aee4759ef8a8 /drivers/spi | |
| parent | 74f0c573d3d415f2248b5a5169575714ce29731d (diff) | |
| download | linux-f5dc5baa5b04ceb0fca2460bc2863921f0e7ede5.tar.gz linux-f5dc5baa5b04ceb0fca2460bc2863921f0e7ede5.tar.bz2 linux-f5dc5baa5b04ceb0fca2460bc2863921f0e7ede5.zip | |
spi: airoha: return an error for continuous mode dirmap creation cases
[ Upstream commit 4314ffce4eb81a6c18700af1b6e29b6e0c6b9e37 ]
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: a403997c12019 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
| -rw-r--r-- | drivers/spi/spi-airoha-snfi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi-airoha-snfi.c b/drivers/spi/spi-airoha-snfi.c index 1369691a997b..6930dea48f33 100644 --- a/drivers/spi/spi-airoha-snfi.c +++ b/drivers/spi/spi-airoha-snfi.c @@ -625,6 +625,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->mem, &desc->info.op_tmpl)) return -EOPNOTSUPP; |
