PCI: iproc: export iproc_pcie_shutdown symbol
Subsystems (2)
PATCH 1/2 PCI: iproc: export iproc_pcie_shutdown symbol
The shutdown bugfix introduce a build regression for allmodconfig kernels as the new function is not exported:
ERROR: "iproc_pcie_shutdown" [drivers/pci/host/pcie-iproc-platform.ko] undefined!
This adds the missing export.
--- drivers/pci/host/pcie-iproc.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/host/pcie-iproc.c +1 -0
@@ -704,6 +704,7 @@ int iproc_pcie_shutdown(struct iproc_pcie *pcie)return 0 ; } +EXPORT_SYMBOL_GPL (iproc_pcie_shutdown);static int iproc_pcie_check_link (struct iproc_pcie *pcie) {
Signature · 1 line
2.9.0
PATCH 2/2 PCI: iproc: fix Stingray CRS defect handling
The condition that was used to detect the PCI_EXP_RTCAP flag access is wrong, as pointed out by gcc-8:
drivers/pci/host/pcie-iproc.c: In function 'iproc_pcie_config_read':drivers/pci/host/pcie-iproc.c:531:22: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
if ((where & ~0x3) == PCI_EXP_CAP + PCI_EXP_RTCAP)
This adds the same bit mask to the other end as well, so the condition is evaluated correctly for any access.
--- drivers/pci/host/pcie-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pcie-iproc.c +1 -1
@@ -528,7 +528,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn,return ret;/* Don't advertise CRS SV support */ -if ((where & ~0x3 ) ==PCI_EXP_CAP +PCI_EXP_RTCAP ) +if ((where & ~0x3 ) == ((PCI_EXP_CAP +PCI_EXP_RTCAP ) & ~0x03 )) *val &= ~(PCI_EXP_RTCAP_CRSVIS <<16 );return PCIBIOS_SUCCESSFUL ; }
Signature · 1 line
2.9.0
Re: [PATCH 2/2] PCI: iproc: fix Stingray CRS defect handling
Quoted 21 lines · Arnd Bergmann
The condition that was used to detect the
PCI_EXP_RTCAPflag access is wrong, as pointed out by gcc-8:
drivers/pci/host/pcie-iproc.c: In function 'iproc_pcie_config_read':drivers/pci/host/pcie-iproc.c:531:22: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
if ((where & ~0x3) ==PCI_EXP_CAP+PCI_EXP_RTCAP)This adds the same bit mask to the other end as well, so the condition is evaluated correctly for any access.
Fixes ac8d3e852f75 ("PCI: iproc: Work around Stingray CRS defects")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/pci/host/pcie-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/host/pcie-iproc.c +0
-0
drivers/pci/host/pcie-iproc.c static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn, · line 534
Quoted 8 lines
drivers/pci/host/pcie-iproc.c +1
-1@@ -528,7 +528,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn,return ret;/* Don't advertise CRS SV support */ -if ((where & ~0x3 ) ==PCI_EXP_CAP +PCI_EXP_RTCAP ) +if ((where & ~0x3 ) == ((PCI_EXP_CAP +PCI_EXP_RTCAP ) & ~0x03 )) *val &= ~(PCI_EXP_RTCAP_CRSVIS <<16 );return PCIBIOS_SUCCESSFUL ; }
Definitely looks like a bug. I'm slightly confused because Oza tested this and reported that lspci said CRS SV was not supported. But there used to be an lspci bug related to reporting CRS SV, and there are a lot of executables that don't have the fix:
http://git.kernel.org/cgit/utils/pciutils/pciutils.git/commit/?id=1cefd379194e
lspci -vvxxx should have enough info to tell for sure. Oza, any chance you could apply the incremental patch (or use my pci/host-iproc branch) and collect that lspci output?
I propose the following slightly different fix because (a) the shift in the next line depends on the fact that we read the 32-bit value that contains both PCI_EXP_RTCTL and PCI_EXP_RTCAP so I like the use of PCI_EXP_RTCTL as a hint that it's involved and (b) there's similar code in xgene_pcie_config_read32() that uses the equivalent of PCI_EXP_RTCTL; see
drivers/pci/host/pcie-iproc.c +1 -1
@@ -528,7 +528,7 @@ static int iproc_pcie_config_read(struct pci_bus *bus, unsigned int devfn,return ret;/* Don't advertise CRS SV support */ -if ((where & ~0x3 ) ==PCI_EXP_CAP +PCI_EXP_RTCAP ) +if ((where & ~0x3 ) ==PCI_EXP_CAP +PCI_EXP_RTCTL ) *val &= ~(PCI_EXP_RTCAP_CRSVIS <<16 );return PCIBIOS_SUCCESSFUL ; }
Quoted 9 lines · Arnd Bergmann
The shutdown bugfix introduce a build regression for allmodconfig kernels as the new function is not exported:
ERROR: "
iproc_pcie_shutdown" [drivers/pci/host/pcie-iproc-platform.ko] undefined!This adds the missing export.
Fixes 2a9912565c05 ("PCI: iproc: Add 500ms delay during device shutdown")Signed-off-by Arnd Bergmann <[email protected]>
Folded into the 2a9912565c05 commit, thanks!
Quoted 24 lines
--- drivers/pci/host/pcie-iproc.c | 1 + 1 file changed, 1 insertion(+)drivers/pci/host/pcie-iproc.c +1
-0@@ -704,6 +704,7 @@ int iproc_pcie_shutdown(struct iproc_pcie *pcie)return 0 ; } +EXPORT_SYMBOL_GPL (iproc_pcie_shutdown);static int iproc_pcie_check_link (struct iproc_pcie *pcie) {Signature · 7 lines
2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel