[PW_SID:1092037] PCI: dwc: Cache PCIe capability offset and simplify drivers#1898
[PW_SID:1092037] PCI: dwc: Cache PCIe capability offset and simplify drivers#1898linux-riscv-bot wants to merge 4 commits into
Conversation
Add a pcie_cap field to struct dw_pcie to store the offset of the PCI Express Capability structure. Provide a helper dw_pcie_get_pcie_cap() which performs the capability search on first call and caches the result. This is a preparatory step for replacing repetitive capability searches in both core and platform drivers. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Modify the DWC core functions to use the cached pcie_cap offset instead of calling dw_pcie_find_capability() each time. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Replace explicit dw_pcie_find_capability(pci, PCI_CAP_ID_EXP) calls with the cached pci->pcie_cap in all DWC-based platform drivers: - i.MX6, Layerscape EP, Meson - Rockchip (also remove redundant NULL check and fix typo) - Eswin, Fu740 - Intel Gateway, Qualcomm EP, Qualcomm RC - Sophgo, Spacemit-k1, Spear13xx - Tegra194 (remove private pcie_cap_base) For drivers that need the offset before the core caches it (e.g., ls_pcie_ep_probe), use dw_pcie_get_pcie_cap() to ensure caching. Adjust variable types from u16 to u8 where appropriate. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 1: "[1/3] PCI: dwc: Add pcie_cap field and helper in designware header" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 2: "[2/3] PCI: dwc: Use cached PCIe capability offset in core" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
|
Patch 3: "[3/3] PCI: dwc: Simplify platform drivers using cached capability offset" |
2d4fcdd to
cd9d421
Compare
PR for series 1092037 applied to workflow__riscv__fixes
Name: PCI: dwc: Cache PCIe capability offset and simplify drivers
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1092037
Version: 1