[PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases

Mikhail Kshevetskiy posted 4 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Mikhail Kshevetskiy 1 month, 3 weeks ago
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
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Frieder Schrempf 1 month, 2 weeks ago
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>
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Mark Brown 1 month, 3 weeks ago
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?
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Mikhail Kshevetskiy 1 month, 3 weeks ago
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
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Miquel Raynal 1 month, 1 week ago
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
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Frieder Schrempf 1 month, 2 weeks ago
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.
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Lorenzo Bianconi 1 month, 2 weeks ago
> 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
Re: [PATCH RESEND v2 4/4] spi: spi-airoha-snfi: return an error for continuous mode dirmap creation cases
Posted by Mikhail Kshevetskiy 1 month, 2 weeks ago
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