public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE
@ 2022-05-02  9:14 Hector Martin
  2022-05-02 11:11 ` Marc Zyngier
  2022-05-04 19:57 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Hector Martin @ 2022-05-02  9:14 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Sven Peter, Alyssa Rosenzweig, Marc Zyngier, linux-arm-kernel,
	linux-kernel, Hector Martin

We're already running into the 512 GPIO limit on t600[01] depending on
how many SMC GPIOs we allocate, and a 2-die version could double that.
Let's make it 2K to be safe for now.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 arch/arm64/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 20ea89d9ac2f..b0da0a28aa2d 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2050,6 +2050,18 @@ config STACKPROTECTOR_PER_TASK
 	def_bool y
 	depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
 
+# The GPIO number here must be sorted by descending number. In case of
+# a multiplatform kernel, we just want the highest value required by the
+# selected platforms.
+config ARCH_NR_GPIO
+        int
+        default 2048 if ARCH_APPLE
+        default 0
+        help
+          Maximum number of GPIOs in the system.
+
+          If unsure, leave the default value.
+
 endmenu
 
 menu "Boot options"
-- 
2.35.1


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

* Re: [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE
  2022-05-02  9:14 [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE Hector Martin
@ 2022-05-02 11:11 ` Marc Zyngier
  2022-05-04 19:57 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2022-05-02 11:11 UTC (permalink / raw)
  To: Hector Martin
  Cc: Catalin Marinas, Will Deacon, Sven Peter, Alyssa Rosenzweig,
	linux-arm-kernel, linux-kernel

On Mon, 02 May 2022 10:14:27 +0100,
Hector Martin <marcan@marcan.st> wrote:
> 
> We're already running into the 512 GPIO limit on t600[01] depending on
> how many SMC GPIOs we allocate, and a 2-die version could double that.
> Let's make it 2K to be safe for now.
> 
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
>  arch/arm64/Kconfig | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 20ea89d9ac2f..b0da0a28aa2d 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -2050,6 +2050,18 @@ config STACKPROTECTOR_PER_TASK
>  	def_bool y
>  	depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
>  
> +# The GPIO number here must be sorted by descending number. In case of
> +# a multiplatform kernel, we just want the highest value required by the
> +# selected platforms.
> +config ARCH_NR_GPIO
> +        int
> +        default 2048 if ARCH_APPLE
> +        default 0
> +        help
> +          Maximum number of GPIOs in the system.
> +
> +          If unsure, leave the default value.
> +
>  endmenu
>  
>  menu "Boot options"

It may be worth pointing out that this doesn't seem to result in any
extra memory allocation, as this only controls the GPIO numbering.

My only worry is that since the allocation is done top-down, the new
limit is going to have a userspace visible impacts (i.e. anything in
/sys/class/gpiochip* will get renumbered). I don't think anyone should
rely on this anyway (they should use the canonical bus path), but this
is worth pointing out as a potential side effect.

Otherwise,

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.

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

* Re: [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE
  2022-05-02  9:14 [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE Hector Martin
  2022-05-02 11:11 ` Marc Zyngier
@ 2022-05-04 19:57 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2022-05-04 19:57 UTC (permalink / raw)
  To: Hector Martin, Will Deacon
  Cc: linux-arm-kernel, Alyssa Rosenzweig, linux-kernel, Marc Zyngier,
	Sven Peter

On Mon, 2 May 2022 18:14:27 +0900, Hector Martin wrote:
> We're already running into the 512 GPIO limit on t600[01] depending on
> how many SMC GPIOs we allocate, and a 2-die version could double that.
> Let's make it 2K to be safe for now.
> 
> 

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE
      https://git.kernel.org/arm64/c/5028fbad2d57

-- 
Catalin


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

end of thread, other threads:[~2022-05-04 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-02  9:14 [PATCH] arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE Hector Martin
2022-05-02 11:11 ` Marc Zyngier
2022-05-04 19:57 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox