[PATCH v3 14/16] PCI: dwc: spear13xx: Use cached PCIe capability offset
Hans Zhang <[email protected]> Mon, 20 Jul 2026 23:06:17 +0800
| Newsgroups | dev.linux.lists.sophgo,dev.linux.lists.imx,dev.linux.lists.spacemit,org.infradead.lists.linux-amlogic,org.infradead.lists.linux-riscv,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-tegra,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <[email protected]> |
Inside .init we must call dw_pcie_get_pcie_cap() to obtain the offset, because the core has not yet cached it. The hardware is already enabled by the driver's own initialization before this point. Signed-off-by: Hans Zhang <[email protected]> --- In pcie-spear13xx, the call chain is: static const struct dw_pcie_host_ops spear13xx_pcie_host_ops = { .init = spear13xx_pcie_host_init, }; spear13xx_pcie_host_init() -> dw_pcie_find_capability() --- drivers/pci/controller/dwc/pcie-spear13xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-spear13xx.c b/drivers/pci/controller/dwc/pcie-spear13xx.c index 01794a9d3ad2..6e4c11b497d4 100644 --- a/drivers/pci/controller/dwc/pcie-spear13xx.c +++ b/drivers/pci/controller/dwc/pcie-spear13xx.c @@ -122,7 +122,7 @@ static int spear13xx_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pci); - u32 exp_cap_off = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); + u8 exp_cap_off = dw_pcie_get_pcie_cap(pci); u32 val; spear13xx_pcie->app_base = pci->dbi_base + 0x2000; -- 2.34.1