Skip to contentSkip to conversation

drivers/pci/controller/dwc/pcie-designware-ep.c:26:undefined reference to `pci_epc_init_notify'

PATCH kernel test robot 3 participants 3 messages Jun 26, 2024 – Jun 28, 2024

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git controller/rockchip
head:   246afbe0f6fca433d8d918b740719170b1b082cc
commit: 9b2ba393b3a659a4695691794dc030b6f7744b23 [10/11] PCI: dw-rockchip: Add endpoint mode support
config: loongarch-randconfig-r081-20240626 (https://download.01.org/0day-ci/archive/20240627/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240627/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_init_notify':

>> drivers/pci/controller/dwc/pcie-designware-ep.c:26:(.text+0x1e4): undefined reference to `pci_epc_init_notify'
   loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_deinit':
>> drivers/pci/controller/dwc/pcie-designware-ep.c:640:(.text+0x83c): undefined reference to `pci_epc_mem_free_addr'
>> loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.c:643:(.text+0x854): undefined reference to `pci_epc_mem_exit'
   loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_linkup':
>> drivers/pci/controller/dwc/pcie-designware-ep.c:811:(.text+0x924): undefined reference to `pci_epc_linkup'
   loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_linkdown':
>> drivers/pci/controller/dwc/pcie-designware-ep.c:836:(.text+0x964): undefined reference to `pci_epc_linkdown'
   loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_init':
>> drivers/pci/controller/dwc/pcie-designware-ep.c:875:(.text+0xe90): undefined reference to `__devm_pci_epc_create'
>> loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.c:888:(.text+0xf20): undefined reference to `pci_epc_mem_init'
>> loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.c:895:(.text+0xf54): undefined reference to `pci_epc_mem_alloc_addr'

loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.c:906:(.text+0xf74): undefined reference to `pci_epc_mem_exit'

vim +26 drivers/pci/controller/dwc/pcie-designware-ep.c

f8aed6ec624fb4 drivers/pci/dwc/pcie-designware-ep.c            Kishon Vijay Abraham I 2017-03-27  17  
7cbebc86c72aa2 drivers/pci/controller/dwc/pcie-designware-ep.c Manivannan Sadhasivam  2024-03-27  18  /**
7cbebc86c72aa2 drivers/pci/controller/dwc/pcie-designware-ep.c Manivannan Sadhasivam  2024-03-27  19   * dw_pcie_ep_init_notify - Notify EPF drivers about EPC initialization complete
7cbebc86c72aa2 drivers/pci/controller/dwc/pcie-designware-ep.c Manivannan Sadhasivam  2024-03-27  20   * @ep: DWC EP device
7cbebc86c72aa2 drivers/pci/controller/dwc/pcie-designware-ep.c Manivannan Sadhasivam  2024-03-27  21   */
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  22  void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep)
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  23  {
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  24  	struct pci_epc *epc = ep->epc;
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  25  
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17 @26  	pci_epc_init_notify(epc);
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  27  }
c57247f940e8ea drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-03-03  28  EXPORT_SYMBOL_GPL(dw_pcie_ep_init_notify);
ac37dde7217764 drivers/pci/controller/dwc/pcie-designware-ep.c Vidya Sagar            2020-02-17  29  

:::::: The code at line 26 was first introduced by commit
:::::: ac37dde721776463f866ba5c93986af19a6b73b9 PCI: dwc: Add API to notify core initialization completion

:::::: TO: Vidya Sagar <[email protected]> :::::: CC: Lorenzo Pieralisi <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 7 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git controller/rockchip
head:   246afbe0f6fca433d8d918b740719170b1b082cc
commit: 9b2ba393b3a659a4695691794dc030b6f7744b23 [10/11] PCI: dw-rockchip: Add endpoint mode support
config: loongarch-randconfig-r081-20240626 (https://download.01.org/0day-ci/archive/20240627/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240627/[email protected]/reproduce)
Quoted 5 lines

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

Hello Krzysztof,

Quoted 4 lines

All errors (new ones prefixed by >>):

loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_init_notify':

Quoted 1 line
Quoted 1 line

drivers/pci/controller/dwc/pcie-designware-ep.c:26:(.text+0x1e4): undefined reference to `pci_epc_init_notify'

Seeing that it is pcie-designware-ep.c that fails to build, I can see the error. I have forgotten to do:

drivers/pci/controller/dwc/Kconfig +1 -0
index 9c4fb8ba7573..4c38181acffa 100644
@@ -329,6 +329,7 @@ config PCIE_ROCKCHIP_DW_EP
        bool "Rockchip DesignWare PCIe controller (endpoint mode)"
        depends on ARCH_ROCKCHIP || COMPILE_TEST
        depends on OF
+       depends on PCI_ENDPOINT
        select PCIE_DW_EP
        select PCIE_ROCKCHIP_DW
        help

(The .config in this build has PCIE_ROCKCHIP_DW_EP selected, but not PCI_ENDPOINT, which should not be allowed...)

This is my fault, all the other endpoint drivers have a depends on PCI_ENDPOINT. Will send a patch for this shortly. I'm truly sorry for this mistake.

Looking more closely at the pci/controller/rockchip branch, I can also see that we have another potential problem:

Commit 7a847796e509 ("PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers"), which is on branch: pci/endpoint
has introduced a stub (dummy definition) for pci_epc_init_notify.
However, if the test robot builds the pci/controller/rockchip branch with PCIE_ROCKCHIP_DW_HOST selected, and not PCIE_ROCKCHIP_DW_EP selected, we could get a failure that pci_epc_init_notify() does not have a stub...

This problem can be solved by cherry-picking 7a847796e509 ("PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers") to the pci/controller/rockchip branch, or by rebasing the pci/controller/rockchip branch on top of the pci/endpoint branch... I'm sorry for this too.

Kind regards,
Niklas

#2 lore raw

Hello,

[...]

Quoted 21 lines
Quoted 4 lines

All errors (new ones prefixed by >>):

loongarch64-linux-ld: drivers/pci/controller/dwc/pcie-designware-ep.o: in function `dw_pcie_ep_init_notify':

Quoted 1 line
Quoted 1 line

drivers/pci/controller/dwc/pcie-designware-ep.c:26:(.text+0x1e4): undefined reference to `pci_epc_init_notify'

Seeing that it is pcie-designware-ep.c that fails to build, I can see the error. I have forgotten to do:

drivers/pci/controller/dwc/Kconfig +1 -0
index 9c4fb8ba7573..4c38181acffa 100644
@@ -329,6 +329,7 @@ config PCIE_ROCKCHIP_DW_EP
        bool "Rockchip DesignWare PCIe controller (endpoint mode)"
        depends on ARCH_ROCKCHIP || COMPILE_TEST
        depends on OF
+       depends on PCI_ENDPOINT
        select PCIE_DW_EP
        select PCIE_ROCKCHIP_DW
        help
Quoted 5 lines

(The .config in this build has PCIE_ROCKCHIP_DW_EP selected, but not PCI_ENDPOINT, which should not be allowed...)

This is my fault, all the other endpoint drivers have a depends on PCI_ENDPOINT. Will send a patch for this shortly. I'm truly sorry for this mistake.

No worries. Thank you for a quick fix! Much appreciated.

Krzysztof