linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Mark Brown <broonie@kernel.org>
Cc: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] spi: Raise limit on number of chip selects
Date: Tue, 23 Jan 2024 12:04:30 +0100	[thread overview]
Message-ID: <20240123120430.75c7ace0@bootlin.com> (raw)
In-Reply-To: <20240122-spi-multi-cs-max-v1-1-a7e98cd5f6c7@kernel.org>

Hi Mark,

On Mon, 22 Jan 2024 01:21:46 +0000
Mark Brown <broonie@kernel.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@roeck-us.net>
> Suggested-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Mark Brown <broonie@kernel.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@ff000000/cpm@9c0/spi@a80/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é


  parent reply	other threads:[~2024-01-23 11:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  1:21 [PATCH] spi: Raise limit on number of chip selects Mark Brown
2024-01-22 22:07 ` Mark Brown
2024-01-23 11:04 ` Herve Codina [this message]
2024-01-23 13:18   ` Mark Brown
2024-01-23 13:26     ` Christophe Leroy
2024-01-23 13:53       ` Mark Brown
2024-01-23 16:50         ` Jonas Gorski
2024-01-23 17:47           ` Guenter Roeck
2024-01-24 13:41             ` Jonas Gorski
2024-01-24 14:35               ` David Laight
2024-01-24 14:59               ` Mark Brown
2024-01-24 15:28                 ` Christophe Leroy
2024-01-24 16:08                   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240123120430.75c7ace0@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=amit.kumar-mahapatra@amd.com \
    --cc=broonie@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).