All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency
@ 2026-10-20 15:03 Geert Uytterhoeven
  2026-10-20 15:11 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-10-20 15:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Bjorn Helgaas, Alex Elder, Daniel Thompson,
	Lorenzo Bianconi, Linus Walleij, Bartosz Golaszewski
  Cc: linux-pci, linux-gpio, Geert Uytterhoeven

The Toshiba TC9563 GPIO controller is embedded in the Toshiba TC9563
PCIe switch, and its auxiliary device is instantiated by the TC9563 PCI
Power Control driver.  Hence make GPIO_TC9563 depend on
PCI_PWRCTRL_TC9563, to prevent asking the user about the GPIO driver
when configuring a kernel without TC9563 PCI Power Control support.
Drop the dependency of PCI_PWRCTRL_TC9563 on GPIO_TC9563, which
represents the wrong inverse relationship.

Fixes: eea9a072221d97ab ("PCI/pwrctrl: tc9563: Add GPIO auxiliary device support")
Fixes: 81ec9c22d06aea92 ("gpio: tc9563: Add support for the embedded GPIO controller")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/gpio/Kconfig        | 1 +
 drivers/pci/pwrctrl/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 5d3f076c539b3a64..c5556b1638b8c113 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1893,6 +1893,7 @@ endmenu
 
 config GPIO_TC9563
 	tristate "Toshiba TC9563 GPIO support"
+	depends on PCI_PWRCTRL_TC9563 || COMPILE_TEST
 	default m if ARCH_QCOM
 	select AUXILIARY_BUS
 	select GPIO_REGMAP
diff --git a/drivers/pci/pwrctrl/Kconfig b/drivers/pci/pwrctrl/Kconfig
index 38aab596aa04b8b1..1952ab4f29b6917a 100644
--- a/drivers/pci/pwrctrl/Kconfig
+++ b/drivers/pci/pwrctrl/Kconfig
@@ -29,7 +29,6 @@ config PCI_PWRCTRL_TC9563
 	select PCI_PWRCTRL
 	default m if ARCH_QCOM
 	depends on I2C
-	depends on GPIO_TC9563
 	select REGMAP_I2C
 	help
 	  Say Y here to enable the PCI Power Control driver of TC9563 PCIe
-- 
2.43.0


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

* Re: [PATCH] PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency
  2026-10-20 15:03 [PATCH] PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency Geert Uytterhoeven
@ 2026-10-20 15:11 ` sashiko-bot
  2026-10-20 15:39   ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: sashiko-bot @ 2026-10-20 15:11 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-pci, linux-gpio

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] PCI/pwrctrl: missing select AUXILIARY_BUS in PCI_PWRCTRL_TC9563
--

commit a7730129e4c039c8e8c890c4f31a553b4c62308d
Author: Geert Uytterhoeven <geert+renesas@glider.be>

PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency

This commit reverses the Kconfig dependency between GPIO_TC9563 and
PCI_PWRCTRL_TC9563 so that GPIO_TC9563 depends on PCI_PWRCTRL_TC9563 ||
COMPILE_TEST instead of PCI_PWRCTRL_TC9563 depending on GPIO_TC9563.

> diff --git a/drivers/pci/pwrctrl/Kconfig b/drivers/pci/pwrctrl/Kconfig
> index 38aab596aa04b..1952ab4f29b69 100644
> --- a/drivers/pci/pwrctrl/Kconfig
> +++ b/drivers/pci/pwrctrl/Kconfig
> @@ -29,7 +29,6 @@ config PCI_PWRCTRL_TC9563
>  	select PCI_PWRCTRL
>  	default m if ARCH_QCOM
>  	depends on I2C
> -	depends on GPIO_TC9563
>  	select REGMAP_I2C
>  	help
>  	  Say Y here to enable the PCI Power Control driver of TC9563 PCIe

[Severity: Low]
Does PCI_PWRCTRL_TC9563 also need to select AUXILIARY_BUS when dropping the
dependency on GPIO_TC9563?

Previously, depending on GPIO_TC9563 transitively selected AUXILIARY_BUS.
Without that dependency, if PCI_PWRCTRL_TC9563 is enabled with GPIO_TC9563=n
and nothing else selects AUXILIARY_BUS, drivers/base/auxiliary.o is not
built:

drivers/base/Makefile:
    obj-$(CONFIG_AUXILIARY_BUS) += auxiliary.o

Meanwhile, tc9563_pwrctrl_adev_add() in
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c unconditionally calls
auxiliary_device_init() and auxiliary_device_add():

drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:tc9563_pwrctrl_adev_add() {
    ...
	ret = auxiliary_device_init(adev);
	if (ret) {
		ida_free(&tc9563_pwrctrl_ida, id);
		of_node_put(adev->dev.of_node);
		kfree(adev);
		return ret;
	}

	ret = auxiliary_device_add(adev);
    ...
}

Can this cause undefined reference link errors for auxiliary_device_init and
__auxiliary_device_add when CONFIG_AUXILIARY_BUS is not enabled?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/889ae6695b19ce57ca4b17526c69b48c9414f5ae.1792508601.git.geert+renesas@glider.be?part=1

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

* Re: [PATCH] PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency
  2026-10-20 15:11 ` sashiko-bot
@ 2026-10-20 15:39   ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-10-20 15:39 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: linux-pci, linux-gpio

Hi Sashiko,

Thanks for your report!

On Tue, 20 Oct 2026 at 17:11, <sashiko-bot@kernel.org> wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] PCI/pwrctrl: missing select AUXILIARY_BUS in PCI_PWRCTRL_TC9563
> --
>
> commit a7730129e4c039c8e8c890c4f31a553b4c62308d
> Author: Geert Uytterhoeven <geert+renesas@glider.be>
>
> PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency
>
> This commit reverses the Kconfig dependency between GPIO_TC9563 and
> PCI_PWRCTRL_TC9563 so that GPIO_TC9563 depends on PCI_PWRCTRL_TC9563 ||
> COMPILE_TEST instead of PCI_PWRCTRL_TC9563 depending on GPIO_TC9563.
>
> > diff --git a/drivers/pci/pwrctrl/Kconfig b/drivers/pci/pwrctrl/Kconfig
> > index 38aab596aa04b..1952ab4f29b69 100644
> > --- a/drivers/pci/pwrctrl/Kconfig
> > +++ b/drivers/pci/pwrctrl/Kconfig
> > @@ -29,7 +29,6 @@ config PCI_PWRCTRL_TC9563
> >       select PCI_PWRCTRL
> >       default m if ARCH_QCOM
> >       depends on I2C
> > -     depends on GPIO_TC9563
> >       select REGMAP_I2C
> >       help
> >         Say Y here to enable the PCI Power Control driver of TC9563 PCIe
>
> [Severity: Low]
> Does PCI_PWRCTRL_TC9563 also need to select AUXILIARY_BUS when dropping the
> dependency on GPIO_TC9563?
>
> Previously, depending on GPIO_TC9563 transitively selected AUXILIARY_BUS.
> Without that dependency, if PCI_PWRCTRL_TC9563 is enabled with GPIO_TC9563=n
> and nothing else selects AUXILIARY_BUS, drivers/base/auxiliary.o is not
> built:
>
> drivers/base/Makefile:
>     obj-$(CONFIG_AUXILIARY_BUS) += auxiliary.o
>
> Meanwhile, tc9563_pwrctrl_adev_add() in
> drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c unconditionally calls
> auxiliary_device_init() and auxiliary_device_add():
>
> drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:tc9563_pwrctrl_adev_add() {
>     ...
>         ret = auxiliary_device_init(adev);
>         if (ret) {
>                 ida_free(&tc9563_pwrctrl_ida, id);
>                 of_node_put(adev->dev.of_node);
>                 kfree(adev);
>                 return ret;
>         }
>
>         ret = auxiliary_device_add(adev);
>     ...
> }
>
> Can this cause undefined reference link errors for auxiliary_device_init and
> __auxiliary_device_add when CONFIG_AUXILIARY_BUS is not enabled?

Indeed, both GPIO_TC9563 and PCI_PWRCTRL_TC9563 need to select
AUXILIARY_BUS.  I will fix this in v2.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2026-10-20 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 15:03 [PATCH] PCI/pwrctrl/gpio: Correct GPIO_TC9563 / PCI_PWRCTRL_TC9563 dependency Geert Uytterhoeven
2026-10-20 15:11 ` sashiko-bot
2026-10-20 15:39   ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.