linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: lpieralisi@kernel.org, robh@kernel.org, andersson@kernel.org
Cc: kw@linux.com, bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	konrad.dybcio@somainline.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org,
	dmitry.baryshkov@linaro.org,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [PATCH v4 09/12] PCI: qcom-ep: Make PERST separation optional
Date: Wed, 14 Sep 2022 13:23:47 +0530	[thread overview]
Message-ID: <20220914075350.7992-10-manivannan.sadhasivam@linaro.org> (raw)
In-Reply-To: <20220914075350.7992-1-manivannan.sadhasivam@linaro.org>

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.

Hence, make the property optional in the driver.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 40f75a6c55df..92140a09aac5 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -220,8 +220,10 @@ static int qcom_pcie_ep_core_reset(struct qcom_pcie_ep *pcie_ep)
  */
 static void qcom_pcie_ep_configure_tcsr(struct qcom_pcie_ep *pcie_ep)
 {
-	regmap_write(pcie_ep->perst_map, pcie_ep->perst_en, 0);
-	regmap_write(pcie_ep->perst_map, pcie_ep->perst_sep_en, 0);
+	if (pcie_ep->perst_map) {
+		regmap_write(pcie_ep->perst_map, pcie_ep->perst_en, 0);
+		regmap_write(pcie_ep->perst_map, pcie_ep->perst_sep_en, 0);
+	}
 }
 
 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,
 
 	syscon = of_parse_phandle(dev->of_node, "qcom,perst-regs", 0);
 	if (!syscon) {
-		dev_err(dev, "Failed to parse qcom,perst-regs\n");
-		return -EINVAL;
+		dev_dbg(dev, "PERST separation not available\n");
+		return 0;
 	}
 
 	pcie_ep->perst_map = syscon_node_to_regmap(syscon);
-- 
2.25.1


  parent reply	other threads:[~2022-09-14  7:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  7:53 [PATCH v4 00/12] Improvements to the Qcom PCIe Endpoint driver Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 01/12] PCI: qcom-ep: Add kernel-doc for qcom_pcie_ep structure Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 02/12] PCI: qcom-ep: Rely on the clocks supplied by devicetree Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 03/12] PCI: qcom-ep: Make use of the cached dev pointer Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 04/12] PCI: qcom-ep: Disable IRQs during driver remove Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 05/12] PCI: qcom-ep: Expose link transition counts via debugfs Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 06/12] PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS Manivannan Sadhasivam
2022-10-05 22:08   ` Bjorn Helgaas
2022-10-05 22:24     ` Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 07/12] PCI: qcom-ep: Disable Master AXI Clock when there is no PCIe traffic Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 08/12] dt-bindings: PCI: qcom-ep: Make PERST separation optional Manivannan Sadhasivam
2022-09-14  7:53 ` Manivannan Sadhasivam [this message]
2022-09-14  7:53 ` [PATCH v4 10/12] dt-bindings: PCI: qcom-ep: Define clocks per platform Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 11/12] dt-bindings: PCI: qcom-ep: Add support for SM8450 SoC Manivannan Sadhasivam
2022-09-14  7:53 ` [PATCH v4 12/12] " Manivannan Sadhasivam
2022-10-03  7:00 ` [PATCH v4 00/12] Improvements to the Qcom PCIe Endpoint driver Manivannan Sadhasivam
2022-10-03  8:40 ` Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220914075350.7992-10-manivannan.sadhasivam@linaro.org \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=andersson@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).