linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vidya Sagar <vidyas@nvidia.com>
To: <bhelgaas@google.com>, <lpieralisi@kernel.org>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
	<jingoohan1@gmail.com>, <gustavo.pimentel@synopsys.com>
Cc: <kw@linux.com>, <kishon@ti.com>, <linux-pci@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kthota@nvidia.com>,
	<mmaddireddy@nvidia.com>, <vidyas@nvidia.com>,
	<sagar.tv@gmail.com>
Subject: [PATCH V6 15/16] PCI: tegra194: Extend endpoint mode support
Date: Thu, 21 Jul 2022 19:50:51 +0530	[thread overview]
Message-ID: <20220721142052.25971-16-vidyas@nvidia.com> (raw)
In-Reply-To: <20220721142052.25971-1-vidyas@nvidia.com>

Since only Controller-5 can be used in the endpoint mode in P2972-0000
platform, support is available only for Controller-5. This patch extends
that support by enabling the endpoint mode capable controller during
initialization phase which otherwise is not required if it is only
Controller-5.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
V6:
* New addition in V6 based on Bjorn's review comment

 drivers/pci/controller/dwc/pcie-tegra194.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index bac2e1ad0a29..fc373b6efd00 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1650,6 +1650,13 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
 		return;
 	}
 
+	ret = tegra_pcie_bpmp_set_ctrl_state(pcie, true);
+	if (ret) {
+		dev_err(pcie->dev, "Failed to enable controller %u: %d\n",
+			pcie->cid, ret);
+		goto fail_set_ctrl_state;
+	}
+
 	ret = tegra_pcie_bpmp_set_pll_state(pcie, true);
 	if (ret) {
 		dev_err(dev, "Failed to init UPHY for PCIe EP: %d\n", ret);
@@ -1798,6 +1805,8 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
 fail_core_clk_enable:
 	tegra_pcie_bpmp_set_pll_state(pcie, false);
 fail_pll_init:
+	tegra_pcie_bpmp_set_ctrl_state(pcie, false);
+fail_set_ctrl_state:
 	pm_runtime_put_sync(dev);
 }
 
-- 
2.17.1


  parent reply	other threads:[~2022-07-21 14:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 14:20 [PATCH V6 00/16] PCI: tegra: Add Tegra234 PCIe support Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 01/16] dt-bindings: pci: tegra: Convert to json-schema Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 02/16] dt-bindings: PCI: tegra234: Add schema for tegra234 rootport mode Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 03/16] dt-bindings: PCI: tegra234: Add schema for tegra234 endpoint mode Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 04/16] arm64: tegra: Add regulators required for PCIe Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 05/16] arm64: tegra: Add P2U and PCIe controller nodes to Tegra234 DT Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 06/16] arm64: tegra: Enable PCIe slots in P3737-0000 board Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 07/16] PCI: Disable MSI for Tegra234 root ports Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 08/16] Revert "PCI: tegra194: Rename tegra_pcie_dw to tegra194_pcie" Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 09/16] PCI: tegra194: Find RAS DES PCIe capability offset Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 10/16] PCI: tegra194: Fix root port interrupt handling Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 11/16] PCI: tegra194: Clear bandwidth management status Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 12/16] PCI: tegra194: Enable support for 256 Byte payload Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 13/16] PCI: tegra194: Cleanup the exit path for endpoint mode Vidya Sagar
2022-07-21 14:20 ` [PATCH V6 14/16] PCI: tegra194: Fix link up retry sequence Vidya Sagar
2022-07-22 21:54   ` Rob Herring
2022-07-21 14:20 ` Vidya Sagar [this message]
2022-07-21 14:20 ` [PATCH V6 16/16] PCI: tegra: Add Tegra234 PCIe support Vidya Sagar
2022-07-22 22:17 ` [PATCH V6 00/16] " Bjorn Helgaas

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=20220721142052.25971-16-vidyas@nvidia.com \
    --to=vidyas@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kishon@ti.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kthota@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=sagar.tv@gmail.com \
    --cc=thierry.reding@gmail.com \
    /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).