linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] spi: Raise limit on number of chip selects
@ 2024-01-24 13:24 Mark Brown
  2024-01-24 18:11 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mark Brown @ 2024-01-24 13:24 UTC (permalink / raw)
  To: Amit Kumar Mahapatra, Guenter Roeck; +Cc: linux-spi, linux-kernel, Mark Brown

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>
---
Changes in v2:
- Raise the limit further, the highest I've seen thus far is 12.
- Link to v1: https://lore.kernel.org/r/20240122-spi-multi-cs-max-v1-1-a7e98cd5f6c7@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..600fbd5daf68 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 16
 
 struct dma_chan;
 struct software_node;

---
base-commit: 65163d16fcaef37733b5f273ffe4d00d731b34de
change-id: 20240121-spi-multi-cs-max-23e82c815c6d

Best regards,
-- 
Mark Brown <broonie@kernel.org>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] spi: Raise limit on number of chip selects
  2024-01-24 13:24 [PATCH v2] spi: Raise limit on number of chip selects Mark Brown
@ 2024-01-24 18:11 ` Mark Brown
  2025-06-26 12:59 ` Marc Kleine-Budde
  2025-06-26 13:12 ` Marc Kleine-Budde
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-01-24 18:11 UTC (permalink / raw)
  To: Amit Kumar Mahapatra, Guenter Roeck, Mark Brown; +Cc: linux-spi, linux-kernel

On Wed, 24 Jan 2024 13:24:24 +0000, Mark Brown 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Raise limit on number of chip selects
      commit: 2f8c7c3715f2c6fb51a4ecc0905c04dd78a3da29

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] spi: Raise limit on number of chip selects
  2024-01-24 13:24 [PATCH v2] spi: Raise limit on number of chip selects Mark Brown
  2024-01-24 18:11 ` Mark Brown
@ 2025-06-26 12:59 ` Marc Kleine-Budde
  2025-06-26 14:12   ` Mark Brown
  2025-06-26 13:12 ` Marc Kleine-Budde
  2 siblings, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-06-26 12:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: Amit Kumar Mahapatra, Guenter Roeck, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

On 24.01.2024 13:24:24, Mark Brown 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.

We currently have a use case for 24 chip selects.

> 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>
> ---
> Changes in v2:
> - Raise the limit further, the highest I've seen thus far is 12.
> - Link to v1: https://lore.kernel.org/r/20240122-spi-multi-cs-max-v1-1-a7e98cd5f6c7@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..600fbd5daf68 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 16

Just further increase the limit to 24? Add a Kconfig symbol?

regards,
Marc

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] spi: Raise limit on number of chip selects
  2024-01-24 13:24 [PATCH v2] spi: Raise limit on number of chip selects Mark Brown
  2024-01-24 18:11 ` Mark Brown
  2025-06-26 12:59 ` Marc Kleine-Budde
@ 2025-06-26 13:12 ` Marc Kleine-Budde
  2 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-06-26 13:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: Amit Kumar Mahapatra, Guenter Roeck, linux-spi, linux-kernel,
	kernel

[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]

(sorry my mail setup had a glitch in my previous mail)

On 24.01.2024 13:24:24, Mark Brown 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.

We currently have a use case for 24 chip selects.

> 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>
> ---
> Changes in v2:
> - Raise the limit further, the highest I've seen thus far is 12.
> - Link to v1: https://lore.kernel.org/r/20240122-spi-multi-cs-max-v1-1-a7e98cd5f6c7@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..600fbd5daf68 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 16

Just further increase the limit to 24? Add a Kconfig symbol?

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] spi: Raise limit on number of chip selects
  2025-06-26 12:59 ` Marc Kleine-Budde
@ 2025-06-26 14:12   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-06-26 14:12 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Amit Kumar Mahapatra, Guenter Roeck, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

On Thu, Jun 26, 2025 at 02:59:35PM +0200, Marc Kleine-Budde wrote:
> On 24.01.2024 13:24:24, Mark Brown wrote:

> >  /* Max no. of CS supported per spi device */
> > -#define SPI_CS_CNT_MAX 4
> > +#define SPI_CS_CNT_MAX 16

> Just further increase the limit to 24? Add a Kconfig symbol?

Just increase the limit, it's probably fine.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] spi: Raise limit on number of chip selects
       [not found] <FR4P281MB343441EB901D3DD286B923D6837AA@FR4P281MB3434.DEUP281.PROD.OUTLOOK.COM>
@ 2025-06-27 11:00 ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-06-27 11:00 UTC (permalink / raw)
  To: Hohn, Torben
  Cc: amit.kumar-mahapatra@amd.com, frogger@hardanger.blackshift.org,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	linux@roeck-us.net

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

On Thu, Jun 26, 2025 at 04:58:20PM +0000, Hohn, Torben wrote:
> Hello Marc,

That isn't my name...

> +#define SPI_CS_CNT_MAX 16

> If this is increased to 24 now, we need to carry another patch on top of mainline again once we add another Chipselect
> into our FPGA, or into the next iteration of our hardware. We would really prefer that a Kconfig value is used.
> We have handed a patch to pengutronix, because they can send proper emails.

> In the IIO framework there is a Konfig Value for something similar:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/iio/trigger.h#n74

This doesn't really work, we're supposed to support single kernel image
so putting per platform configuration in Kconfig ends up being at best a
usability problem.  At some point it's better to just bite the bullet
and make things dynamic.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-27 11:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 13:24 [PATCH v2] spi: Raise limit on number of chip selects Mark Brown
2024-01-24 18:11 ` Mark Brown
2025-06-26 12:59 ` Marc Kleine-Budde
2025-06-26 14:12   ` Mark Brown
2025-06-26 13:12 ` Marc Kleine-Budde
     [not found] <FR4P281MB343441EB901D3DD286B923D6837AA@FR4P281MB3434.DEUP281.PROD.OUTLOOK.COM>
2025-06-27 11:00 ` Mark Brown

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).