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>
---
drivers/spi/spi-airoha-snfi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-airoha-snfi.c b/drivers/spi/spi-airoha-snfi.c
index dbe640986825..043a03cd90a1 100644
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@@ -618,6 +618,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;
--
2.50.1
Am 14.08.25 um 08:54 schrieb Mikhail Kshevetskiy: > 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>
On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: > 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. This seems like it just applies anyway regardless of the rest of the series?
On 14.08.2025 18:29, Mark Brown wrote: > On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: >> 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. > This seems like it just applies anyway regardless of the rest of the > series? Could you provide a link? I do not see this in upstream linux repo. Mikhail Kshevetskiy
On 14/08/2025 at 18:33:25 +03, Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> wrote: > On 14.08.2025 18:29, Mark Brown wrote: >> On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: >>> 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. >> This seems like it just applies anyway regardless of the rest of the >> series? > > Could you provide a link? I do not see this in upstream linux repo. No link, Mark can apply this without the rest of the series it seems. If that's the case, it's best to send two series because these patches apply to different trees. Thanks, Miquèl
Am 14.08.25 um 17:33 schrieb Mikhail Kshevetskiy: > > On 14.08.2025 18:29, Mark Brown wrote: >> On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: >>> 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. >> This seems like it just applies anyway regardless of the rest of the >> series? > > Could you provide a link? I do not see this in upstream linux repo. Mark asked if this could be applied without the other patches of this series through his SPI tree and I think that is indeed correct. The other patches are still being reviewed and applied via the MTD tree.
> Am 14.08.25 um 17:33 schrieb Mikhail Kshevetskiy: > > > > On 14.08.2025 18:29, Mark Brown wrote: > >> On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: > >>> 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. > >> This seems like it just applies anyway regardless of the rest of the > >> series? > > > > Could you provide a link? I do not see this in upstream linux repo. > > Mark asked if this could be applied without the other patches of this > series through his SPI tree and I think that is indeed correct. The > other patches are still being reviewed and applied via the MTD tree. Can you please add the following Fixes tag? Fixes: a403997c12019 ("spi: airoha: add SPI-NAND Flash controller driver") Regards, Lorenzo
On 20.08.2025 11:49, Frieder Schrempf wrote: > Am 14.08.25 um 17:33 schrieb Mikhail Kshevetskiy: >> On 14.08.2025 18:29, Mark Brown wrote: >>> On Thu, Aug 14, 2025 at 09:54:23AM +0300, Mikhail Kshevetskiy wrote: >>>> 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. >>> This seems like it just applies anyway regardless of the rest of the >>> series? >> Could you provide a link? I do not see this in upstream linux repo. > Mark asked if this could be applied without the other patches of this > series through his SPI tree and I think that is indeed correct. The > other patches are still being reviewed and applied via the MTD tree. Thanks for clarification. I could add it to other aihoha spi driver fixes. Mikhail
© 2016 - 2025 Red Hat, Inc.