]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: dw-rockchip: Move rockchip_pcie_ep_hide_broken_ats_cap_rk3588() to dw_pcie_ep_op...
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 14 Apr 2025 01:28:29 +0000 (09:28 +0800)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Sun, 27 Apr 2025 11:22:44 +0000 (16:52 +0530)
In the case of PERST# deassert, non-sticky registers will get reset to
their hardware default state and EXT_CAP registers are one among them. But
since the broken ATS cap is hidden only in dw_pcie_ep_ops::pre_init()
callback which is not gettting called during PERST# deassert, it results in
the capability getting advertised again.

So move it to dw_pcie_ep_ops::init() to fix it.

Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
[mani: subject and description rewording]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://patch.msgid.link/1744594109-209312-1-git-send-email-shawn.lin@rock-chips.com
drivers/pci/controller/dwc/pcie-dw-rockchip.c

index e4519c020ea98678f0a133fc9abcbcd641facdc1..7790a9f33e48ebcfa37f86f7a22405d8f50ce73a 100644 (file)
@@ -278,17 +278,13 @@ static void rockchip_pcie_ep_hide_broken_ats_cap_rk3588(struct dw_pcie_ep *ep)
                dev_err(dev, "failed to hide ATS capability\n");
 }
 
-static void rockchip_pcie_ep_pre_init(struct dw_pcie_ep *ep)
-{
-       rockchip_pcie_ep_hide_broken_ats_cap_rk3588(ep);
-}
-
 static void rockchip_pcie_ep_init(struct dw_pcie_ep *ep)
 {
        struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
        enum pci_barno bar;
 
        rockchip_pcie_enable_l0s(pci);
+       rockchip_pcie_ep_hide_broken_ats_cap_rk3588(ep);
 
        for (bar = 0; bar < PCI_STD_NUM_BARS; bar++)
                dw_pcie_ep_reset_bar(pci, bar);
@@ -359,7 +355,6 @@ rockchip_pcie_get_features(struct dw_pcie_ep *ep)
 
 static const struct dw_pcie_ep_ops rockchip_pcie_ep_ops = {
        .init = rockchip_pcie_ep_init,
-       .pre_init = rockchip_pcie_ep_pre_init,
        .raise_irq = rockchip_pcie_raise_irq,
        .get_features = rockchip_pcie_get_features,
 };