linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
@ 2021-08-06 14:37 Andy Shevchenko
  2021-08-11 13:14 ` Linus Walleij
  2021-08-16 13:25 ` Rafael J. Wysocki
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2021-08-06 14:37 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, linux-acpi
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	H. Peter Anvin, hdegoede, Linus Walleij, Bartosz Golaszewski,
	Rafael J. Wysocki, Andy Shevchenko

By default the 512 GPIOs is a maximum on any x86 platform.
With, for example, Intel Tiger Lake-H the SoC based controller
occupies up to 480 pins. This leaves only 32 available for
GPIO expanders or other drivers, like PMIC. Hence, bump the
maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 45962aaf2b2c..495ed6229b52 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -340,6 +340,19 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
 config ARCH_HIBERNATION_POSSIBLE
 	def_bool y
 
+# 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 1024 if X86_64
+	default 512 if X86_32
+	default 0
+	help
+	  Maximum number of GPIOs in the system.
+
+	  If unsure, leave the default value.
+
 config ARCH_SUSPEND_POSSIBLE
 	def_bool y
 
-- 
2.30.2


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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-06 14:37 [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64 Andy Shevchenko
@ 2021-08-11 13:14 ` Linus Walleij
  2021-08-11 13:41   ` Andy Shevchenko
  2021-08-16 13:25 ` Rafael J. Wysocki
  1 sibling, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2021-08-11 13:14 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-kernel, open list:GPIO SUBSYSTEM, ACPI Devel Maling List,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	H. Peter Anvin, Hans de Goede, Bartosz Golaszewski,
	Rafael J. Wysocki

On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> By default the 512 GPIOs is a maximum on any x86 platform.
> With, for example, Intel Tiger Lake-H the SoC based controller
> occupies up to 480 pins. This leaves only 32 available for
> GPIO expanders or other drivers, like PMIC. Hence, bump the
> maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks reasonable to me.
The goal with the whole descriptor refactoring is to get this
completely dynamic but it turns out to take forever. It is as it
is.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-11 13:14 ` Linus Walleij
@ 2021-08-11 13:41   ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2021-08-11 13:41 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, open list:GPIO SUBSYSTEM, ACPI Devel Maling List,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	H. Peter Anvin, Hans de Goede, Bartosz Golaszewski,
	Rafael J. Wysocki

On Wed, Aug 11, 2021 at 03:14:59PM +0200, Linus Walleij wrote:
> On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > By default the 512 GPIOs is a maximum on any x86 platform.
> > With, for example, Intel Tiger Lake-H the SoC based controller
> > occupies up to 480 pins. This leaves only 32 available for
> > GPIO expanders or other drivers, like PMIC. Hence, bump the
> > maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Looks reasonable to me.
> The goal with the whole descriptor refactoring is to get this
> completely dynamic but it turns out to take forever. It is as it
> is.
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!

Rafael, can you please review this?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-06 14:37 [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64 Andy Shevchenko
  2021-08-11 13:14 ` Linus Walleij
@ 2021-08-16 13:25 ` Rafael J. Wysocki
  2021-08-16 13:35   ` Andy Shevchenko
  1 sibling, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2021-08-16 13:25 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	ACPI Devel Maling List, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Hans de Goede, Linus Walleij, Bartosz Golaszewski,
	Rafael J. Wysocki

On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> By default the 512 GPIOs is a maximum on any x86 platform.
> With, for example, Intel Tiger Lake-H the SoC based controller
> occupies up to 480 pins. This leaves only 32 available for
> GPIO expanders or other drivers, like PMIC. Hence, bump the
> maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/x86/Kconfig | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 45962aaf2b2c..495ed6229b52 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -340,6 +340,19 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
>  config ARCH_HIBERNATION_POSSIBLE
>         def_bool y
>
> +# 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 1024 if X86_64
> +       default 512 if X86_32
> +       default 0

Wouldn't

default 1024 if X86_64
default 512

be sufficient?

It's either X86_64 or X86_32 anyway AFAICS.

> +       help
> +         Maximum number of GPIOs in the system.
> +
> +         If unsure, leave the default value.
> +
>  config ARCH_SUSPEND_POSSIBLE
>         def_bool y
>
> --

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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-16 13:25 ` Rafael J. Wysocki
@ 2021-08-16 13:35   ` Andy Shevchenko
  2021-08-16 13:55     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2021-08-16 13:35 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	ACPI Devel Maling List, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Hans de Goede, Linus Walleij, Bartosz Golaszewski,
	Rafael J. Wysocki

On Mon, Aug 16, 2021 at 03:25:13PM +0200, Rafael J. Wysocki wrote:
> On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > By default the 512 GPIOs is a maximum on any x86 platform.
> > With, for example, Intel Tiger Lake-H the SoC based controller
> > occupies up to 480 pins. This leaves only 32 available for
> > GPIO expanders or other drivers, like PMIC. Hence, bump the
> > maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.

Thanks for review, my answers below.

> > +# 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 1024 if X86_64
> > +       default 512 if X86_32
> > +       default 0
> 
> Wouldn't
> 
> default 1024 if X86_64
> default 512
> 
> be sufficient?
> 
> It's either X86_64 or X86_32 anyway AFAICS.

I guess so.

> > +       help
> > +         Maximum number of GPIOs in the system.
> > +
> > +         If unsure, leave the default value.

Btw, what do you think. do we need comment above and help text here? I copied
these from ARM, but I'm not sure it would be useful on x86 as much.


-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-16 13:35   ` Andy Shevchenko
@ 2021-08-16 13:55     ` Rafael J. Wysocki
  2021-08-16 14:48       ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2021-08-16 13:55 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List,
	open list:GPIO SUBSYSTEM, ACPI Devel Maling List,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	the arch/x86 maintainers, H. Peter Anvin, Hans de Goede,
	Linus Walleij, Bartosz Golaszewski, Rafael J. Wysocki

On Mon, Aug 16, 2021 at 3:35 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Mon, Aug 16, 2021 at 03:25:13PM +0200, Rafael J. Wysocki wrote:
> > On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > By default the 512 GPIOs is a maximum on any x86 platform.
> > > With, for example, Intel Tiger Lake-H the SoC based controller
> > > occupies up to 480 pins. This leaves only 32 available for
> > > GPIO expanders or other drivers, like PMIC. Hence, bump the
> > > maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.
>
> Thanks for review, my answers below.
>
> > > +# 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 1024 if X86_64
> > > +       default 512 if X86_32
> > > +       default 0
> >
> > Wouldn't
> >
> > default 1024 if X86_64
> > default 512
> >
> > be sufficient?
> >
> > It's either X86_64 or X86_32 anyway AFAICS.
>
> I guess so.
>
> > > +       help
> > > +         Maximum number of GPIOs in the system.
> > > +
> > > +         If unsure, leave the default value.
>
> Btw, what do you think. do we need comment above and help text here? I copied
> these from ARM, but I'm not sure it would be useful on x86 as much.

Both the comment and the help text aren't particularly useful IMO.

The comment is a bit confusing even, because x86 kernels are
multiplatform as a rule.

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

* Re: [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64
  2021-08-16 13:55     ` Rafael J. Wysocki
@ 2021-08-16 14:48       ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2021-08-16 14:48 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	ACPI Devel Maling List, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, H. Peter Anvin,
	Hans de Goede, Linus Walleij, Bartosz Golaszewski,
	Rafael J. Wysocki

On Mon, Aug 16, 2021 at 03:55:59PM +0200, Rafael J. Wysocki wrote:
> On Mon, Aug 16, 2021 at 3:35 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Mon, Aug 16, 2021 at 03:25:13PM +0200, Rafael J. Wysocki wrote:
> > > On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:

...

> > > Wouldn't
> > >
> > > default 1024 if X86_64
> > > default 512
> > >
> > > be sufficient?
> > >
> > > It's either X86_64 or X86_32 anyway AFAICS.

Fixed in v2.

...

> > Btw, what do you think. do we need comment above and help text here? I copied
> > these from ARM, but I'm not sure it would be useful on x86 as much.
> 
> Both the comment and the help text aren't particularly useful IMO.
> 
> The comment is a bit confusing even, because x86 kernels are
> multiplatform as a rule.

Ditto.


-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2021-08-16 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 14:37 [PATCH v1 1/1] x86/platform: Increase maximum GPIO number for X86_64 Andy Shevchenko
2021-08-11 13:14 ` Linus Walleij
2021-08-11 13:41   ` Andy Shevchenko
2021-08-16 13:25 ` Rafael J. Wysocki
2021-08-16 13:35   ` Andy Shevchenko
2021-08-16 13:55     ` Rafael J. Wysocki
2021-08-16 14:48       ` Andy Shevchenko

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