mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manikanta Maddireddy <mmaddireddy@nvidia.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Jingoo Han <jingoohan1@gmail.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Krzysztof Wilczynski <kwilczynski@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jon Hunter <jonathanh@nvidia.com>,
	Vidya Sagar <vidyas@nvidia.com>,
	Niklas Cassel <cassel@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH 3/3] PCI: tegra194: Notify Endpoint functions on PERST# assert
Date: Mon, 19 Oct 2026 16:49:34 +0530	[thread overview]
Message-ID: <14bc9d0e-ece4-4cd5-99b6-b53b9ce27157@nvidia.com> (raw)
In-Reply-To: <ogerzdjwq5wus3eb436x5gylxyfekmir7rz72ycywd2xoaiank@h7ayvhizjpu7>



On 17/10/26 2:52 pm, Manivannan Sadhasivam wrote:
> On Wed, Sep 23, 2026 at 12:55:54PM +0530, Manikanta Maddireddy wrote:
>> Tegra Endpoint mode powers the controller down when the host asserts
>> PERST#. EPF drivers must be told about link down before that happens,
>> otherwise remove while PERST# is asserted can free EPC resources while
>> EPF work is still active.
>>
>> Use pci_epc_linkdown() directly in the PERST# assert path. It is a
>> software-only EPF notification
> 
> Not entirely true. The EPF drivers can still access the hardware registers in
> the link_down() callback. But most likely they won't access any DBI registers,
> so that access may still be OK without REFCLK.

Agreed, “software-only” is too strong. The direct notification avoids 
the DWC helper’s DBI accesses, but EPF callbacks still need auditing for 
operation without REFCLK. I’ll correct that wording and remove both the 
unrelated deinit paragraph and pointer cleanup.

- Manikanta>
>> and avoids dw_pcie_ep_linkdown(), which
>> reinitializes non-sticky DWC registers and touches DBI while the host
>> REFCLK may be disappearing.
>>
>> Keep pci_epc_deinit_notify() in the PERST# deassert path, after core
>> reset is deasserted, because EPF deinit callbacks can clear BARs and
>> therefore need register access. If remove runs while the controller is
>> already powered down, pex_ep_event_pex_rst_assert() returns because
>> ep_state is disabled; that is safe because the link-down notification
>> was sent at the earlier PERST# assert.
>>
>> The final dw_pcie_ep_deinit() does not require Tegra register access
>> today: Tegra uses its own MSI-X address-match window instead of the
>> DWC MSI iATU, and the supported DTs do not register a DWC eDMA device.
>>
> 
> Is the last paragraph related to this patch?
> 
>> Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
>> ---
>>   drivers/pci/controller/dwc/pcie-tegra194.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
>> index dd3f4c30ba52..3e9d46850a78 100644
>> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
>> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
>> @@ -1724,6 +1724,7 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
>>   
>>   static void pex_ep_event_pex_rst_assert(struct tegra_pcie_dw *pcie)
>>   {
>> +	struct dw_pcie_ep *ep = &pcie->pci.ep;
>>   	u32 val;
>>   	int ret;
>>   
>> @@ -1745,6 +1746,8 @@ 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);
>>   
>> +	pci_epc_linkdown(ep->epc);
>> +
>>   	/*
>>   	 * Deassert LTSSM state to stop the state toggling between
>>   	 * Polling and Detect.
>> @@ -1913,7 +1916,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
>>   	}
>>   
>>   	/* Perform cleanup that requires refclk and core reset deasserted */
>> -	pci_epc_deinit_notify(pcie->pci.ep.epc);
>> +	pci_epc_deinit_notify(ep->epc);
> 
> Unrelated change.
> 
> - Mani
> 

-- 
nvpublic


      reply	other threads:[~2026-10-19 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  7:25 [PATCH 0/3] PCI: dwc: Avoid full EP cleanup on PERST# Manikanta Maddireddy
2026-09-23  7:25 ` [PATCH 1/3] PCI: dwc: Add Endpoint reinit helper Manikanta Maddireddy
2026-10-17  9:27   ` Manivannan Sadhasivam
2026-10-19 11:15     ` Manikanta Maddireddy
2026-09-23  7:25 ` [PATCH 2/3] PCI: tegra194: Avoid full Endpoint reinit on PERST# Manikanta Maddireddy
2026-10-17  9:17   ` Manivannan Sadhasivam
2026-10-19 11:17     ` Manikanta Maddireddy
2026-09-23  7:25 ` [PATCH 3/3] PCI: tegra194: Notify Endpoint functions on PERST# assert Manikanta Maddireddy
2026-10-17  9:22   ` Manivannan Sadhasivam
2026-10-19 11:19     ` Manikanta Maddireddy [this message]

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=14bc9d0e-ece4-4cd5-99b6-b53b9ce27157@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®