[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240123120430.75c7ace0@bootlin.com>
Date: Tue, 23 Jan 2024 12:04:30 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: Mark Brown <broonie@...nel.org>
Cc: Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>, Guenter Roeck
<linux@...ck-us.net>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, Christophe Leroy
<christophe.leroy@...roup.eu>, Thomas Petazzoni
<thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH] spi: Raise limit on number of chip selects
Hi Mark,
On Mon, 22 Jan 2024 01:21:46 +0000
Mark Brown <broonie@...nel.org> wrote:
> As reported by Guenter the limit we've got on the number of chip selects is
> set too low for some systems, raise the limit. We should really remove the
> hard coded limit but this is needed as a fix so let's do the simple thing
> and raise the limit for now.
>
> Fixes: 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")
> Reported-by: Guenter Roeck <linux@...ck-us.net>
> Suggested-by: Guenter Roeck <linux@...ck-us.net>
> Signed-off-by: Mark Brown <broonie@...nel.org>
> ---
> include/linux/spi/spi.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index 471fe2ff9066..d71483bf253a 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -21,7 +21,7 @@
> #include <uapi/linux/spi/spi.h>
>
> /* Max no. of CS supported per spi device */
> -#define SPI_CS_CNT_MAX 4
> +#define SPI_CS_CNT_MAX 8
>
> struct dma_chan;
> struct software_node;
>
I got also the issue related to SPI_CS_CNT_MAX introduced by 4d8ff6b0991d ("spi:
Add multi-cs memories support in SPI core").
Errors like the following one are raised at boot for each of my SPI devices:
spi_master spi0: No. of CS is more than max. no. of supported CS
spi_master spi0: Failed to create SPI device for /soc@...00000/cpm@.../spi@.../idt821034@0
and none of my SPI devices were probed.
On my system, 9 SPI devices are present on my SPI bus and so, I have 9 chip-selects
(gpio chip-selects in my case).
Moving the SPI_CS_CNT_MAX value from 4 to 8 is not enough to handle my case.
Tested moving SPI_CS_CNT_MAX to 16 and it was ok.
Best regards,
Hervé
Powered by blists - more mailing lists