[PATCH v10 02/16] spi: airoha: remove unnecessary restriction length

Mikhail Kshevetskiy posted 16 patches 2 months ago
[PATCH v10 02/16] spi: airoha: remove unnecessary restriction length
Posted by Mikhail Kshevetskiy 2 months ago
The "length < 160" restriction is not needed because airoha_snand_write_data()
and airoha_snand_read_data() will properly handle data transfers above
SPI_MAX_TRANSFER_SIZE.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/spi/spi-airoha-snfi.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/spi/spi-airoha-snfi.c b/drivers/spi/spi-airoha-snfi.c
index 043a03cd90a1..bcc464ec9c61 100644
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@@ -579,13 +579,6 @@ static int airoha_snand_adjust_op_size(struct spi_mem *mem,
 
 		if (op->data.nbytes > max_len)
 			op->data.nbytes = max_len;
-	} else {
-		max_len = 1 + op->addr.nbytes + op->dummy.nbytes;
-		if (max_len >= 160)
-			return -EOPNOTSUPP;
-
-		if (op->data.nbytes > 160 - max_len)
-			op->data.nbytes = 160 - max_len;
 	}
 
 	return 0;
-- 
2.51.0
Re: [PATCH v10 02/16] spi: airoha: remove unnecessary restriction length
Posted by Mark Brown 2 months ago
On Sun, Oct 12, 2025 at 03:16:53PM +0300, Mikhail Kshevetskiy wrote:
> The "length < 160" restriction is not needed because airoha_snand_write_data()
> and airoha_snand_read_data() will properly handle data transfers above
> SPI_MAX_TRANSFER_SIZE.

Non-fix changes should be after fixes so there aren't any spurious
dependencies.
Re: [PATCH v10 02/16] spi: airoha: remove unnecessary restriction length
Posted by Mikhail Kshevetskiy 2 months ago
On 10/16/25 15:04, Mark Brown wrote:
> On Sun, Oct 12, 2025 at 03:16:53PM +0300, Mikhail Kshevetskiy wrote:
>> The "length < 160" restriction is not needed because airoha_snand_write_data()
>> and airoha_snand_read_data() will properly handle data transfers above
>> SPI_MAX_TRANSFER_SIZE.
> Non-fix changes should be after fixes so there aren't any spurious
> dependencies.

Could you give me an advice?

This patch series consist of:
1) bug fixes (patches 1, 3, 5, 6, 13)
2) removing of boot related dirty hack, absolutely necessary for older
kernels (patch 12 and preparation patches 9-11)
3) improvements (patches: 2, 8)
4) cleanups (patches: 4, 7)
5) support of en7523 SoC (patches: 14-16)

What will be the best order of changes?

Regards,
Mikhail Kshevetskiy
Re: [PATCH v10 02/16] spi: airoha: remove unnecessary restriction length
Posted by Mark Brown 2 months ago
On Thu, Oct 16, 2025 at 04:39:19PM +0300, Mikhail Kshevetskiy wrote:

> Could you give me an advice?

> This patch series consist of:
> 1) bug fixes (patches 1, 3, 5, 6, 13)

I note that 13 isn't tagged as a fix.

> 2) removing of boot related dirty hack, absolutely necessary for older
> kernels (patch 12 and preparation patches 9-11)
> 3) improvements (patches: 2, 8)
> 4) cleanups (patches: 4, 7)
> 5) support of en7523 SoC (patches: 14-16)

Fixes, cleanups, general improvements, the new device support.
Re: [PATCH v10 02/16] spi: airoha: remove unnecessary restriction length
Posted by Mikhail Kshevetskiy 2 months ago
On 10/16/25 18:07, Mark Brown wrote:
> On Thu, Oct 16, 2025 at 04:39:19PM +0300, Mikhail Kshevetskiy wrote:
>
>> Could you give me an advice?
>> This patch series consist of:
>> 1) bug fixes (patches 1, 3, 5, 6, 13)
> I note that 13 isn't tagged as a fix.

In most cases this driver will be called from spinand code. Spinand code
provides the same logic, thus patch 13 will do nothing. But if airoha
spi will be called outside of spinand code -- patch 13 becomes necessary.
  

>
>> 2) removing of boot related dirty hack, absolutely necessary for older
>> kernels (patch 12 and preparation patches 9-11)
>> 3) improvements (patches: 2, 8)
>> 4) cleanups (patches: 4, 7)
>> 5) support of en7523 SoC (patches: 14-16)
> Fixes, cleanups, general improvements, the new device support.
Thanks