From: Manikanta Maddireddy <mmaddireddy@nvidia.com>
To: <jingoohan1@gmail.com>, <mani@kernel.org>,
<lpieralisi@kernel.org>, <kwilczynski@kernel.org>,
<bhelgaas@google.com>, <linux-pci@vger.kernel.org>
Cc: <robh@kernel.org>, <thierry.reding@kernel.org>,
<jonathanh@nvidia.com>, <vidyas@nvidia.com>, <cassel@kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<mmaddireddy@nvidia.com>
Subject: [PATCH v3 3/4] PCI: tegra194: Notify Endpoint functions on PERST# assert
Date: Mon, 2 Nov 2026 16:44:49 +0530 [thread overview]
Message-ID: <20261102111450.4010818-4-mmaddireddy@nvidia.com> (raw)
In-Reply-To: <20261102111450.4010818-1-mmaddireddy@nvidia.com>
Tegra powers down the Endpoint controller when the host asserts PERST#.
Notify EPF drivers of link down before disabling the controller so their
link_down callbacks can quiesce outstanding work. For example,
pci_epf_test_link_down() synchronously cancels its command worker.
Without this notification, the worker can remain active after the
controller is powered down and while EPC resources are later removed.
Call pci_epc_linkdown() directly instead of dw_pcie_ep_linkdown(), which
also reinitializes non-sticky DWC registers through DBI when the host
may already have withdrawn REFCLK. The direct notification avoids that
common DWC register reinitialization. It does not guarantee that EPF
callbacks are register-free: they can access MMIO and must tolerate the
hardware state at PERST# assertion, including unavailable DBI access.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
---
Changes V2 -> V3:
- No code changes from v2; rebased onto the current PCI main-based stack.
Changes V1 -> V2:
- Clarify that the direct notification avoids common DWC DBI register
reinitialization, but EPF callbacks may still access hardware.
- Add a comment explaining why dw_pcie_ep_linkdown() is not used.
- Drop the unrelated pci_epc_deinit_notify() pointer cleanup.
- Remove unrelated teardown and deferred-deinit discussion from the
commit message.
drivers/pci/controller/dwc/pcie-tegra194.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 08d6f4c5220f..df679509677d 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1740,6 +1740,9 @@ static void pex_ep_event_pex_rst_assert(struct tegra_pcie_dw *pcie)
if (ret)
dev_info(pcie->dev, "LTSSM state: 0x%x detect timeout: %d\n", val, ret);
+ /* Avoid the DBI register reinitialization in dw_pcie_ep_linkdown(). */
+ pci_epc_linkdown(pcie->pci.ep.epc);
+
/*
* Deassert LTSSM state to stop the state toggling between
* Polling and Detect.
--
2.34.1
next prev parent reply other threads:[~2026-11-02 11:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 11:14 [PATCH v3 0/4] PCI: dwc: Avoid full EP cleanup on PERST# Manikanta Maddireddy
2026-11-02 11:14 ` [PATCH v3 1/4] PCI: dwc: Reuse Endpoint resources after fundamental reset Manikanta Maddireddy
2026-11-02 11:14 ` [PATCH v3 2/4] PCI: tegra194: Avoid full Endpoint reinit on PERST# Manikanta Maddireddy
2026-11-02 11:14 ` Manikanta Maddireddy [this message]
2026-11-02 11:14 ` [PATCH v3 4/4] PCI: tegra194: Add PCI_ENDPOINT dependency Manikanta Maddireddy
2026-11-02 15:20 ` Niklas Cassel
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=20261102111450.4010818-4-mmaddireddy@nvidia.com \
--to=mmaddireddy@nvidia.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=jingoohan1@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=thierry.reding@kernel.org \
--cc=vidyas@nvidia.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
all inboxes | Powered by JetHome®