Re: [PATCH v7 09/13] PCI: tegra194: Allow system suspend when the Endpoint link is not up

From: Manivannan Sadhasivam

Date: Sun Mar 15 2026 - 21:34:37 EST


On Sun, Mar 15, 2026 at 07:40:04PM +0530, Manikanta Maddireddy wrote:
>
>
> On 05/03/26 3:59 pm, Manivannan Sadhasivam wrote:
> > On Tue, Mar 03, 2026 at 12:24:44PM +0530, Manikanta Maddireddy wrote:
> > > From: Vidya Sagar <vidyas@xxxxxxxxxx>
> > >
> > > Only a Root Port initiates the L2 sequence. PCIe link is kept in L2 state
> >
> > It is not Root Port, it is the host software which initiates the L2 entry
> > sequence.
> >
> > And L2 is only guaranteed if the Vaux is available.
> >
> I will fix the commit message.
>
> > > during suspend. If Endpoint mode is enabled and the link is up, the
> > > software cannot proceed with suspend. However, when the PCIe Endpoint
> > > driver is probed, but the PCIe link is not up, Tegra can go into suspend
> > > state. So, allow system to suspend in this case.
> > >
> > > Fixes: de2bbf2b71bb ("PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode")
> > > Reviewed-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > > Tested-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> > > Signed-off-by: Vidya Sagar <vidyas@xxxxxxxxxx>
> > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@xxxxxxxxxx>
> > > ---
> > > Changes V1 -> V7: None
> > >
> > > drivers/pci/controller/dwc/pcie-tegra194.c | 31 +++++++++++++++++-----
> > > 1 file changed, 25 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> > > index 5b79d3c28ba6..b2794be35cfe 100644
> > > --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> > > +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> > > @@ -2267,16 +2267,28 @@ static void tegra_pcie_dw_remove(struct platform_device *pdev)
> > > gpiod_set_value(pcie->pex_refclk_sel_gpiod, 0);
> > > }
> > > -static int tegra_pcie_dw_suspend_late(struct device *dev)
> > > +static int tegra_pcie_dw_suspend(struct device *dev)
> > > {
> > > struct tegra_pcie_dw *pcie = dev_get_drvdata(dev);
> > > - u32 val;
> > > if (pcie->of_data->mode == DW_PCIE_EP_TYPE) {
> > > - dev_err(dev, "Failed to Suspend as Tegra PCIe is in EP mode\n");
> > > - return -EPERM;
> > > + if (pcie->ep_state == EP_STATE_ENABLED) {
> > > + dev_err(dev, "Tegra PCIe is in EP mode, suspend not allowed\n");
> > > + return -EPERM;
> > > + }
> > > +
> > > + disable_irq(pcie->pex_rst_irq);
> >
> > So you just disable PERST# IRQ during suspend? And even if the host deasserts
> > PERST#, EP is not going to wakeup?
> >
> > Technically it is possible that whenever the EP wakes up, it will see PERST# IRQ
> > since PERST# is level triggered, but it just sounds dumb to let the endpoint
> > sleep after host deasserting PERST#.
> >
> > - Mani
> >
> I need to check if PERST# line in Tegra has wake feature and corresponding
> PMC changes are available. Anyway adding wake feature will be separate
> patch. In this current patch, I am trying to reduce the impact of Endpoint
> on suspend. If Endpoint is never initialized I don't see a reason to block
> suspend. Are you OK with this current patch to reduce the impact on suspend?
> Or do you have any suggestions?
>

Fine with me. I was just checking the possibility of waking the endpoint during
PERST# deassert.

- Mani

--
மணிவண்ணன் சதாசிவம்