lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <mznt4mfn7z2l5bctdnuul3murx4ykibd2n4dgtavowb3xmhluk@kqxn3uexz7l5>
Date: Thu, 6 Nov 2025 17:39:21 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: zhangsenchuan <zhangsenchuan@...incomputing.com>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>, 
	lpieralisi@...nel.org, kwilczynski@...nel.org, bhelgaas@...gle.com, will@...nel.org, 
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, robh@...nel.org, 
	linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 3/3] PCI: dwc: Skip PME_Turn_Off and L2/L3 transition if
 no device is available

On Thu, Nov 06, 2025 at 06:02:55PM +0800, zhangsenchuan wrote:
> 
> 
> 
> > -----Original Messages-----
> > From: "Manivannan Sadhasivam" <manivannan.sadhasivam@....qualcomm.com>
> > Send time:Thursday, 06/11/2025 14:13:26
> > To: lpieralisi@...nel.org, kwilczynski@...nel.org, mani@...nel.org, bhelgaas@...gle.com
> > Cc: will@...nel.org, linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, robh@...nel.org, linux-arm-msm@...r.kernel.org, zhangsenchuan@...incomputing.com, "Manivannan Sadhasivam" <manivannan.sadhasivam@....qualcomm.com>
> > Subject: [PATCH 3/3] PCI: dwc: Skip PME_Turn_Off and L2/L3 transition if no device is available
> > 
> > If there is no device available under the Root Ports, there is no point in
> > sending PME_Turn_Off and waiting for L2/L3 transition, it will result in a
> > timeout.
> > 
> > Hence, skip those steps if no device is available during suspend. The
> > resume flow remains unchanged.
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
> > ---
> >  drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> > index 20c9333bcb1c..b6b8139e91e3 100644
> > --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> > @@ -20,6 +20,7 @@
> >  #include <linux/platform_device.h>
> >  
> >  #include "../../pci.h"
> > +#include "../pci-host-common.h"
> >  #include "pcie-designware.h"
> >  
> >  static struct pci_ops dw_pcie_ops;
> > @@ -1129,6 +1130,9 @@ int dw_pcie_suspend_noirq(struct dw_pcie *pci)
> >  	u32 val;
> >  	int ret;
> >  
> > +	if (!pci_root_ports_have_device(pci->pp.bridge->bus))
> > +		goto stop_link;
> > +
> >  	/*
> >  	 * If L1SS is supported, then do not put the link into L2 as some
> >  	 * devices such as NVMe expect low resume latency.
> > @@ -1162,6 +1166,7 @@ int dw_pcie_suspend_noirq(struct dw_pcie *pci)
> >  	 */
> >  	udelay(1);
> >  
> > +stop_link:
> >  	dw_pcie_stop_link(pci);
> >  	if (pci->pp.ops->deinit)
> >  		pci->pp.ops->deinit(&pci->pp);
> > -- 
> > 2.48.1
> 
> hi, Manivannan
> 
> I'd like your advice on a few things.
> 
> If there is no device available under the Root Ports, the dw_pcie_wait_for_link
> function in dw_pcie_resume_noirq still need to wait for the link_up? Otherwise
> linkup will TIMEDOUT. At this time, when the resume function return, -ETIMEDOUT 
> returned which will raise "PM: failed to resume noirq: error -110".
> 

I thought about it, but was worried that if there was no device inserted before
suspend, but if one gets inserted during suspend (before resume), then the link
up failure will get un-noticed if the link doesn't come up for the new device
and we skip the timeout.

But thinking more, it occurs to me that it will be a very rare case. So I'll
skip returning timeout from dw_pcie_wait_for_link() if there were no devices
before suspend. However, I do think that the dw_pcie_wait_for_link() should not
be skipped even if there were no devices earlier.

- Mani

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ