Re: drivers/pci/controller/cadence/pci-j721e.c:648:undefined reference to `cdns_pcie_host_disable'
From: Manivannan Sadhasivam
Date: Tue Nov 11 2025 - 06:06:07 EST
+ Siddharth
On Tue, Nov 11, 2025 at 05:28:54PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 4427259cc7f7571a157fbc9b5011e1ef6fe0a4a8
> commit: 1c72774df028429836eec3394212f2921bb830fc PCI: sg2042: Add Sophgo SG2042 PCIe driver
> date: 8 weeks ago
> config: loongarch-randconfig-r113-20251110 (https://download.01.org/0day-ci/archive/20251111/202511111705.MZ7ls8Hm-lkp@xxxxxxxxx/config)
> compiler: loongarch64-linux-gcc (GCC) 15.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251111/202511111705.MZ7ls8Hm-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202511111705.MZ7ls8Hm-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> loongarch64-linux-ld: drivers/pci/controller/cadence/pci-j721e.o: in function `j721e_pcie_remove':
> >> drivers/pci/controller/cadence/pci-j721e.c:648:(.text+0x83c): undefined reference to `cdns_pcie_host_disable'
>
>From .config:
CONFIG_PCIE_CADENCE=y
CONFIG_PCIE_CADENCE_HOST=m
CONFIG_PCIE_CADENCE_EP=y
CONFIG_PCIE_CADENCE_PLAT=y
# CONFIG_PCIE_CADENCE_PLAT_HOST is not set
CONFIG_PCIE_CADENCE_PLAT_EP=y
CONFIG_PCIE_SG2042_HOST=m
CONFIG_PCI_J721E=y
# CONFIG_PCI_J721E_HOST is not set
CONFIG_PCI_J721E_EP=y
PCI_J721E selects PCIE_CADENCE_HOST only if PCI_J721E_HOST is selected,
otherwise, it will not select it. This will take care of the dependency between
PCI_J721E and PCIE_CADENCE_{HOST/EP}.
But if PCIE_CADENCE_HOST is selected as a module by other drivers like,
CONFIG_PCIE_SG2042_HOST=m, then if PCI_J721E is selected as a built-in using
CONFIG_PCI_J721E_EP=y, it results in this build error as the built-in driver
becomes dependent on a symbol from a loadable module.
I guess, we should force PCIE_CADENCE_{HOST/EP} to be 'bool' as it is getting
selected by multiple drivers.
- Mani
--
மணிவண்ணன் சதாசிவம்