pci: fix build error with !PCIE_ECRC
Subsystems (2)
PATCH 1/1 pci: fix build error with !PCIE_ECRC
Fix this build error:drivers/built-in.o: In function `pci_init_capabilities':drivers/pci/probe.c:989: undefined reference to pcie_set_ecrc_checking' drivers/built-in.o: In function pci_setup':drivers/pci/pci.c:2547: undefined reference to `pcie_ecrc_get_policy'
---
drivers/pci/pci.c | 2 ++ drivers/pci/pcie/Kconfig | 2 +- drivers/pci/probe.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletions(-)
drivers/pci/pci.c +2 -0
@@ -2543,8 +2543,10 @@ static int __init pci_setup(char *str) }else if (!strncmp (str,"resource_alignment=" ,19 )) {pci_set_resource_alignment_param (str +19 ,strlen (str +19 )); +#ifdef CONFIG_PCIE_ECRC }else if (!strncmp (str,"ecrc=" ,5 )) {pcie_ecrc_get_policy (str +5 ); +#endif }else {printk (KERN_ERR "PCI: Unknown option `%s'\n" , str);
drivers/pci/pcie/Kconfig +1 -1
@@ -52,7 +52,7 @@ config PCIEASPM_DEBUG # config PCIE_ECRC bool "PCI Express ECRC support" - depends on PCI + depends on PCI && PCIEPORTBUS help Enables PCI Express ECRC (transaction layer end-to-end CRC checking)
drivers/pci/probe.c +2 -0
@@ -985,8 +985,10 @@ static void pci_init_capabilities(struct pci_dev *dev)/* Single Root I/O Virtualization */ pci_iov_init (dev); +#ifdef CONFIG_PCIE_ECRC /* PCIe end-to-end CRC checking */ pcie_set_ecrc_checking (dev); +#endif }void pci_device_add (struct pci_dev *dev,struct pci_bus *bus)
drivers/pci/pcie/Kconfig config PCIEASPM_DEBUG · line 55
Quoted 10 lines · Alexander Beregalov
Fix this build error:
drivers/built-in.o: In function `pci_init_capabilities':drivers/pci/probe.c:989: undefined reference topcie_set_ecrc_checking' drivers/built-in.o: In functionpci_setup':drivers/pci/pci.c:2547: undefined reference to `pcie_ecrc_get_policy'config
PCIE_ECRCdrivers/pci/pcie/Kconfig +1
-1bool "PCI Express ECRC support" - depends on PCI + depends on PCI && PCIEPORTBUS
How does this part of the patch relate to the above description?
Signature · 4 lines
Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
2009/4/7 Matthew Wilcox <[email protected]>:
Quoted 7 lines · Alexander Beregalov
Quoted 5 lines
Fix this build error:
drivers/built-in.o: In function `pci_init_capabilities':drivers/pci/probe.c:989: undefined reference topcie_set_ecrc_checking' drivers/built-in.o: In functionpci_setup':drivers/pci/pci.c:2547: undefined reference to `pcie_ecrc_get_policy'
Quoted 6 lines
Quoted 4 lines
config
PCIE_ECRC
bool "PCI Express ECRC support"
- depends on PCI
+ depends on PCI && PCIEPORTBUSHow does this part of the patch relate to the above description?
Right, I agree. This should be another patch "PCIE_ECRC should depend on PCIE"
When I found this problem PCIE_ECRC was set, but was not be built in. My problem needs both patches to be fixed, I will send them few hours later.
Quoted 34 lines · Alexander Beregalov
Fix this build error:
drivers/built-in.o: In function `pci_init_capabilities':drivers/pci/probe.c:989: undefined reference topcie_set_ecrc_checking' drivers/built-in.o: In functionpci_setup':drivers/pci/pci.c:2547: undefined reference to `pcie_ecrc_get_policy'Signed-off-by Alexander Beregalov <[email protected]>---
drivers/pci/pci.c | 2 ++ drivers/pci/pcie/Kconfig | 2 +- drivers/pci/probe.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletions(-)drivers/pci/pci.c +2
-0@@ -2543,8 +2543,10 @@ static int __init pci_setup(char *str) }else if (!strncmp (str,"resource_alignment=" ,19 )) {pci_set_resource_alignment_param (str +19 ,strlen (str +19 )); +#ifdef CONFIG_PCIE_ECRC }else if (!strncmp (str,"ecrc=" ,5 )) {pcie_ecrc_get_policy (str +5 ); +#endif }else {printk (KERN_ERR "PCI: Unknown option `%s'\n" , str);drivers/pci/pcie/Kconfig +0
-0
drivers/pci/pcie/Kconfig config PCIEASPM_DEBUG · line 55
Quoted 5 lines
drivers/pci/pcie/Kconfig +1
-1@@ -52,7 +52,7 @@ config PCIEASPM_DEBUG # config PCIE_ECRC bool "PCI Express ECRC support" - depends on PCI + depends on PCI && PCIEPORTBUS
We really only need this. There are empty functions in include/linux/pci.h to handle the case where PCIE_ECRC is not defined. The problem is that the code in drivers/pci/pcie is only compiled if PCIEPORTBUS is defined. This feature does not depend on any PCIEPORTBUS code. So either ecrc.c needs to be moved to drivers/pci or we need to not assume that drivers/pci/pcie is only for the portbus driver.
Quoted 19 lines
drivers/pci/pcie/Kconfig +0
-0help Enables PCI Express ECRC (transaction layer end-to-end CRC checking)drivers/pci/probe.c +2
-0@@ -985,8 +985,10 @@ static void pci_init_capabilities(struct pci_dev *dev)/* Single Root I/O Virtualization */ pci_iov_init (dev); +#ifdef CONFIG_PCIE_ECRC /* PCIe end-to-end CRC checking */ pcie_set_ecrc_checking (dev); +#endif }void pci_device_add (struct pci_dev *dev,struct pci_bus *bus)
Signature · 2 lines
Andrew Patterson Hewlett-Packard
Quoted 42 lines · On Tue, 07 Apr 2009 17:33:49 +0000 Andrew Patterson <[email protected]>…
Quoted 35 lines · Alexander Beregalov
Fix this build error:
drivers/built-in.o: In function `pci_init_capabilities':drivers/pci/probe.c:989: undefined reference topcie_set_ecrc_checking' drivers/built-in.o: In functionpci_setup':drivers/pci/pci.c:2547: undefined reference to `pcie_ecrc_get_policy'Signed-off-by Alexander Beregalov <[email protected]>---
drivers/pci/pci.c | 2 ++ drivers/pci/pcie/Kconfig | 2 +- drivers/pci/probe.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletions(-)drivers/pci/pci.c +0
-0@@ -2543,8 +2543,10 @@ static int __init pci_setup(char *str) } else if (!strncmp(str,"resource_alignment=", 19)) { pci_set_resource_alignment_param(str
+ 19, strlen(str + 19));drivers/pci/pci.c +2
-0+#ifdef CONFIG_PCIE_ECRC } else if (!strncmp(str, "ecrc=", 5)) {pcie_ecrc_get_policy (str +5 ); +#endif } else { printk(KERN_ERR "PCI: Unknownoption `%s'\n", str);
drivers/pci/pcie/Kconfig +0
-0drivers/pci/pcie/Kconfig config PCIEASPM_DEBUG · line 55
Quoted 5 lines
drivers/pci/pcie/Kconfig +1
-1@@ -52,7 +52,7 @@ config PCIEASPM_DEBUG # config PCIE_ECRC bool "PCI Express ECRC support" - depends on PCI + depends on PCI && PCIEPORTBUS
Quoted 8 lines
We really only need this. There are empty functions in
include/linux/pci.hto handle the case wherePCIE_ECRCis not defined. The problem is that the code indrivers/pci/pcieis only compiled if PCIEPORTBUS is defined. This feature does not depend on any PCIEPORTBUS code. So eitherecrc.cneeds to be moved todrivers/pcior we need to not assume thatdrivers/pci/pcieis only for the portbus driver.
Btw I dropped this patch back out in light of Kenji-san's comments, so I expect any subsequent version to include a fix for the build issue.
Thanks,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center