Skip to content

Commit 997e010

Browse files
jhovoldbjorn-helgaas
authored andcommitted
PCI: qcom: Fix host-init error handling
Implement the new host_deinit() callback so that the PHY is powered off and regulators and clocks are disabled also on late host-init errors. Link: https://lore.kernel.org/r/[email protected] Fixes: 82a8238 ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 720e0d9 commit 997e010

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,8 +1534,19 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
15341534
return ret;
15351535
}
15361536

1537+
static void qcom_pcie_host_deinit(struct dw_pcie_rp *pp)
1538+
{
1539+
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
1540+
struct qcom_pcie *pcie = to_qcom_pcie(pci);
1541+
1542+
qcom_ep_reset_assert(pcie);
1543+
phy_power_off(pcie->phy);
1544+
pcie->cfg->ops->deinit(pcie);
1545+
}
1546+
15371547
static const struct dw_pcie_host_ops qcom_pcie_dw_ops = {
1538-
.host_init = qcom_pcie_host_init,
1548+
.host_init = qcom_pcie_host_init,
1549+
.host_deinit = qcom_pcie_host_deinit,
15391550
};
15401551

15411552
/* Qcom IP rev.: 2.1.0 Synopsys IP rev.: 4.01a */

0 commit comments

Comments
 (0)