Skip to contentSkip to conversation

spi: Raise limit on number of chip selects

PATCH In review Mark Brown 3 participants 5 messages Jan 24, 2024 – Jun 26, 2025 SPI

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH v2 1/1 spi: Raise limit on number of chip selects

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

---
Changes in v2:
- Raise the limit further, the highest I've seen thus far is 12.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 include/linux/spi/spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/spi/spi.h +1 -1
index 471fe2ff9066..600fbd5daf68 100644
@@ -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,

Signature · 1 line
Mark Brown <[email protected]>
author maintainer
#1 lore raw
Quoted 6 lines · 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.

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

#2 lore raw
In reply to Mark Brown
Quoted 4 lines · 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.

We currently have a use case for 24 chip selects.

Quoted 17 lines
Fixes 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")

---
Changes in v2:
- Raise the limit further, the highest I've seen thus far is 12.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 include/linux/spi/spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/spi/spi.h +0 -0
index 471fe2ff9066..600fbd5daf68 100644

include/linux/spi/spi.h line 24

Quoted 5 lines
include/linux/spi/spi.h +1 -1
@@ -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

author maintainer
#3 lore raw
Quoted 7 lines · Marc Kleine-Budde

include/linux/spi/spi.h line 24

Quoted 3 lines · Mark Brown

/* Max no. of CS supported per spi device */

include/linux/spi/spi.h +1 -1
-#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.

#4 lore raw
In reply to Mark Brown

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

Quoted 4 lines · 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.

We currently have a use case for 24 chip selects.

Quoted 17 lines
Fixes 4d8ff6b0991d ("spi: Add multi-cs memories support in SPI core")

---
Changes in v2:
- Raise the limit further, the highest I've seen thus far is 12.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 include/linux/spi/spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/spi/spi.h +0 -0
index 471fe2ff9066..600fbd5daf68 100644

include/linux/spi/spi.h line 24

Quoted 5 lines
include/linux/spi/spi.h +1 -1
@@ -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

Signature · 4 lines
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   |