Skip to content

Commit aa4b175

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: qcom-ep: Make PERST separation optional
PERST separation is an optional debug feature used to collect the crash dump from the PCIe endpoint devices by the PCIe host when the endpoint crashes. This feature keeps the PCIe link up by separating the PCIe IP block from the SoC reset logic. Make the property optional in the driver. Link: https://lore.kernel.org/r/20220914075350.7992-10-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 299915d commit aa4b175

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ static int qcom_pcie_ep_core_reset(struct qcom_pcie_ep *pcie_ep)
220220
*/
221221
static void qcom_pcie_ep_configure_tcsr(struct qcom_pcie_ep *pcie_ep)
222222
{
223-
regmap_write(pcie_ep->perst_map, pcie_ep->perst_en, 0);
224-
regmap_write(pcie_ep->perst_map, pcie_ep->perst_sep_en, 0);
223+
if (pcie_ep->perst_map) {
224+
regmap_write(pcie_ep->perst_map, pcie_ep->perst_en, 0);
225+
regmap_write(pcie_ep->perst_map, pcie_ep->perst_sep_en, 0);
226+
}
225227
}
226228

227229
static int qcom_pcie_dw_link_up(struct dw_pcie *pci)
@@ -478,8 +480,8 @@ static int qcom_pcie_ep_get_io_resources(struct platform_device *pdev,
478480

479481
syscon = of_parse_phandle(dev->of_node, "qcom,perst-regs", 0);
480482
if (!syscon) {
481-
dev_err(dev, "Failed to parse qcom,perst-regs\n");
482-
return -EINVAL;
483+
dev_dbg(dev, "PERST separation not available\n");
484+
return 0;
483485
}
484486

485487
pcie_ep->perst_map = syscon_node_to_regmap(syscon);

0 commit comments

Comments
 (0)