* [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies
@ 2026-08-05 10:50 Aksh Garg
2026-08-05 17:29 ` Randy Dunlap
2026-08-06 16:47 ` Manivannan Sadhasivam
0 siblings, 2 replies; 3+ messages in thread
From: Aksh Garg @ 2026-08-05 10:50 UTC (permalink / raw)
To: linux-pci, lpieralisi, kwilczynski, mani, robh, bhelgaas,
mpillai, rdunlap, 18255117159, unicorn_wang
Cc: linux-kernel, s-vadapalli, danishanwar, a-garg7
The cadence-plat driver has a single platform driver that can be built-in
or a loadable module, but it calls two separate backend drivers depending
on whether it is a host or endpoint.
If one of the mode is build as built-in and another as loadable module,
we end up with a situation where the built-in pcie-cadence-plat driver
tries to call the modular host or endpoint driver, which causes a link
failure:
ld: error: undefined symbol: cdns_pcie_ep_setup
>>> referenced by pcie-cadence-plat.c
>>> drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a
ld: error: undefined symbol: cdns_pcie_host_setup
>>> referenced by pcie-cadence-plat.c
>>> drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a
Fix this by moving the 'select' of PCIE_CADENCE_HOST and PCIE_CADENCE_EP
from the individual PLAT_HOST/PLAT_EP symbols into the common PCIE_CADENCE_PLAT
symbol, conditioned on which backends (modes) are enabled.
Fixes: 611627a4e5e4 ("PCI: cadence: Add module support for platform controller driver")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/linux-next/589ea512-93c6-4e1c-83d7-ba45a0b35843@infradead.org/
Signed-off-by: Aksh Garg <a-garg7@ti.com>
---
drivers/pci/controller/cadence/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig
index 9e651d545973..fd704dec47dd 100644
--- a/drivers/pci/controller/cadence/Kconfig
+++ b/drivers/pci/controller/cadence/Kconfig
@@ -20,11 +20,12 @@ config PCIE_CADENCE_EP
config PCIE_CADENCE_PLAT
tristate
+ select PCIE_CADENCE_HOST if PCIE_CADENCE_PLAT_HOST != n
+ select PCIE_CADENCE_EP if PCIE_CADENCE_PLAT_EP != n
config PCIE_CADENCE_PLAT_HOST
tristate "Cadence platform PCIe controller (host mode)"
depends on OF
- select PCIE_CADENCE_HOST
select PCIE_CADENCE_PLAT
help
Say Y here if you want to support the Cadence PCIe platform controller in
@@ -35,7 +36,6 @@ config PCIE_CADENCE_PLAT_EP
tristate "Cadence platform PCIe controller (endpoint mode)"
depends on OF
depends on PCI_ENDPOINT
- select PCIE_CADENCE_EP
select PCIE_CADENCE_PLAT
help
Say Y here if you want to support the Cadence PCIe platform controller in
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies
2026-08-05 10:50 [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies Aksh Garg
@ 2026-08-05 17:29 ` Randy Dunlap
2026-08-06 16:47 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2026-08-05 17:29 UTC (permalink / raw)
To: Aksh Garg, linux-pci, lpieralisi, kwilczynski, mani, robh,
bhelgaas, mpillai, 18255117159, unicorn_wang
Cc: linux-kernel, s-vadapalli, danishanwar
On 8/5/26 3:50 AM, Aksh Garg wrote:
> The cadence-plat driver has a single platform driver that can be built-in
> or a loadable module, but it calls two separate backend drivers depending
> on whether it is a host or endpoint.
>
> If one of the mode is build as built-in and another as loadable module,
> we end up with a situation where the built-in pcie-cadence-plat driver
> tries to call the modular host or endpoint driver, which causes a link
> failure:
>
> ld: error: undefined symbol: cdns_pcie_ep_setup
> >>> referenced by pcie-cadence-plat.c
> >>> drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a
>
> ld: error: undefined symbol: cdns_pcie_host_setup
> >>> referenced by pcie-cadence-plat.c
> >>> drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a
>
> Fix this by moving the 'select' of PCIE_CADENCE_HOST and PCIE_CADENCE_EP
> from the individual PLAT_HOST/PLAT_EP symbols into the common PCIE_CADENCE_PLAT
> symbol, conditioned on which backends (modes) are enabled.
>
> Fixes: 611627a4e5e4 ("PCI: cadence: Add module support for platform controller driver")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/linux-next/589ea512-93c6-4e1c-83d7-ba45a0b35843@infradead.org/
> Signed-off-by: Aksh Garg <a-garg7@ti.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> drivers/pci/controller/cadence/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/cadence/Kconfig b/drivers/pci/controller/cadence/Kconfig
> index 9e651d545973..fd704dec47dd 100644
> --- a/drivers/pci/controller/cadence/Kconfig
> +++ b/drivers/pci/controller/cadence/Kconfig
> @@ -20,11 +20,12 @@ config PCIE_CADENCE_EP
>
> config PCIE_CADENCE_PLAT
> tristate
> + select PCIE_CADENCE_HOST if PCIE_CADENCE_PLAT_HOST != n
> + select PCIE_CADENCE_EP if PCIE_CADENCE_PLAT_EP != n
>
> config PCIE_CADENCE_PLAT_HOST
> tristate "Cadence platform PCIe controller (host mode)"
> depends on OF
> - select PCIE_CADENCE_HOST
> select PCIE_CADENCE_PLAT
> help
> Say Y here if you want to support the Cadence PCIe platform controller in
> @@ -35,7 +36,6 @@ config PCIE_CADENCE_PLAT_EP
> tristate "Cadence platform PCIe controller (endpoint mode)"
> depends on OF
> depends on PCI_ENDPOINT
> - select PCIE_CADENCE_EP
> select PCIE_CADENCE_PLAT
> help
> Say Y here if you want to support the Cadence PCIe platform controller in
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies
2026-08-05 10:50 [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies Aksh Garg
2026-08-05 17:29 ` Randy Dunlap
@ 2026-08-06 16:47 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2026-08-06 16:47 UTC (permalink / raw)
To: linux-pci, lpieralisi, kwilczynski, mani, robh, bhelgaas,
mpillai, rdunlap, 18255117159, unicorn_wang, Aksh Garg
Cc: linux-kernel, s-vadapalli, danishanwar
On Wed, 05 Aug 2026 16:20:14 +0530, Aksh Garg wrote:
> The cadence-plat driver has a single platform driver that can be built-in
> or a loadable module, but it calls two separate backend drivers depending
> on whether it is a host or endpoint.
>
> If one of the mode is build as built-in and another as loadable module,
> we end up with a situation where the built-in pcie-cadence-plat driver
> tries to call the modular host or endpoint driver, which causes a link
> failure:
>
> [...]
Applied, thanks!
[1/1] PCI: cadence-plat: Fix host/endpoint dependencies
commit: e4486b0dc8b2496133f38451babd7e84e2f4a1fd
Best regards,
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-06 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-05 10:50 [PATCH] PCI: cadence-plat: Fix host/endpoint dependencies Aksh Garg
2026-08-05 17:29 ` Randy Dunlap
2026-08-06 16:47 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®