public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: zhangsenchuan <zhangsenchuan@eswincomputing.com>
To: "Manivannan Sadhasivam" <mani@kernel.org>
Cc: bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org,
	lpieralisi@kernel.org, kwilczynski@kernel.org, robh@kernel.org,
	p.zabel@pengutronix.de, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	christian.bruel@foss.st.com, shradha.t@samsung.com,
	krishna.chundru@oss.qualcomm.com, thippeswamy.havalige@amd.com,
	inochiama@gmail.com, Frank.li@nxp.com, ningyu@eswincomputing.com,
	linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com,
	ouyanghui@eswincomputing.com
Subject: Re: Re: [PATCH v10 2/2] PCI: eic7700: Add Eswin PCIe host controller driver
Date: Thu, 26 Feb 2026 17:37:48 +0800 (GMT+08:00)	[thread overview]
Message-ID: <470bb42a.39bb.19c994fc998.Coremail.zhangsenchuan@eswincomputing.com> (raw)
In-Reply-To: <rbmoxlc45bf4ij2o2mf3ofgni6vxqmsp52vdiqtc4wxxufmxkt@w2u5rkpq5mhs>

> > > > > Subject: Re: [PATCH v10 2/2] PCI: eic7700: Add Eswin PCIe host controller driver
> > > > > 
> > > > > On Thu, Jan 29, 2026 at 05:29:00PM +0800, zhangsenchuan@eswincomputing.com wrote:
> > > > > > From: Senchuan Zhang <zhangsenchuan@eswincomputing.com>
> > > > > >
> > > > > > +static int eic7700_pcie_suspend_noirq(struct device *dev)
> > > > > > +{
> > > > > > +	struct eic7700_pcie *pcie = dev_get_drvdata(dev);
> > > > > > +
> > > > > > +	/*
> > > > > > +	 * The ESWIN EIC7700 SoC lacks hardware support for the L2/L3 low-power
> > > > > > +	 * link states. It cannot enter the L2/L3 Ready state through the
> > > > > > +	 * PME_Turn_Off/PME_To_Ack handshake protocol. To avoid this problem,
> > > > > > +	 * the dw_pcie_suspend_noirq API is not used.
> > > > > > +	 */
> > > > > 
> > > > > With 7.0, you can provide a dummy pme_turn_off() API and set
> > > > > 'pci->pp.skip_l23_ready' to reuse the dw_pcie_{suspend/resume}_noirq APIs.
> > > > > 
> > > > 
> > > > Hi Mani,
> > > > 
> > > > Setting pci->pp.skip_l23_ready does indeed allow us to reuse the
> > > > dw_pcie_suspend_noirq function. However, for the dw_pcie_resume_noirq
> > > > function, if the dw_pcie_start_link and dw_pcie_wait_for_link APIs fail to
> > > > execute, the clk/reset resources in the pci->pp.ops->init function cannot
> > > > be released. Perhaps the dw_pcie_resume_noirq function needs to be optimized.
> > > 
> > > Will this help?
> > > 
> > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> > > index 6ae6189e9b8a..38ad79bbeab1 100644
> > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> > > @@ -1300,15 +1300,24 @@ int dw_pcie_resume_noirq(struct dw_pcie *pci)
> > >  
> > >         ret = dw_pcie_start_link(pci);
> > >         if (ret)
> > > -               return ret;
> > > +               goto err_deinit;
> > >  
> > >         ret = dw_pcie_wait_for_link(pci);
> > >         if (ret)
> > > -               return ret;
> > > +               goto err_stop_link;
> > >  
> > >         if (pci->pp.ops->post_init)
> > >                 pci->pp.ops->post_init(&pci->pp);
> > >  
> > > +       return 0;
> > > +
> > > +err_stop_link:
> > > +       dw_pcie_stop_link(pci);
> > > +
> > > +err_deinit:
> > > +       if (pci->pp.ops->deinit)
> > > +               pci->pp.ops->deinit(&pci->pp);
> > > +
> > >         return ret;
> > >  }
> > >  EXPORT_SYMBOL_GPL(dw_pcie_resume_noirq);
> > > 
> > 
> > Yes, this can release the resources after init, after optimizing the 
> > resume function, i can reuse the dw_pcie_{suspend/resume}_noirq APIs.
> > 
> > I noticed that the dw_pcie_wait_for_link function has been optimized. Is 
> > it necessary to release the resources only when it return -ETIMEOUT?
> > Perhaps it needs to be slightly improved:
> > 
> >  ret = dw_pcie_wait_for_link(pci);
> >  if (ret == -ETIMEOUT)
> >          goto err_stop_link;
> > 
> > What about your suggestion?
> > 
> 
> Absolutely! I forgot my own rework ;) I'll cook a patch for the above. Then if
> you base your controller driver patch on top of it, we can merge both in a
> single tree (if Bjorn agrees).
> 

Okey,thanks!

I'm a little unsure. Do I need to send the v11 patch here first? Or should I wait
until you release the new fix patch, and then send the v11 patch?

Kind regards,
Senchuan


  reply	other threads:[~2026-02-26  9:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  9:26 [PATCH v10 0/2] Add driver support for Eswin EIC7700 SoC PCIe controller zhangsenchuan
2026-01-29  9:28 ` [PATCH v10 1/2] dt-bindings: PCI: eic7700: Add Eswin PCIe host controller zhangsenchuan
2026-01-29  9:29 ` [PATCH v10 2/2] PCI: eic7700: Add Eswin PCIe host controller driver zhangsenchuan
2026-02-18 12:47   ` Manivannan Sadhasivam
2026-02-24  8:14     ` zhangsenchuan
2026-02-25 13:37       ` Manivannan Sadhasivam
2026-02-26  8:09         ` zhangsenchuan
2026-02-26  8:36           ` Manivannan Sadhasivam
2026-02-26  9:37             ` zhangsenchuan [this message]
2026-02-26 13:46               ` Manivannan Sadhasivam
2026-02-27 11:22                 ` zhangsenchuan
2026-02-01 12:24 ` [PATCH v10 0/2] Add driver support for Eswin EIC7700 SoC PCIe controller Leon Romanovsky
2026-02-01 12:28   ` Leon Romanovsky
2026-02-02 10:57     ` Manivannan Sadhasivam
2026-02-01 12:25 ` Leon Romanovsky
2026-02-02 10:59 ` Manivannan Sadhasivam
2026-02-06 22:20   ` 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=470bb42a.39bb.19c994fc998.Coremail.zhangsenchuan@eswincomputing.com \
    --to=zhangsenchuan@eswincomputing.com \
    --cc=Frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=christian.bruel@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=inochiama@gmail.com \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linmin@eswincomputing.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=ningyu@eswincomputing.com \
    --cc=ouyanghui@eswincomputing.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pinkesh.vaghela@einfochips.com \
    --cc=robh@kernel.org \
    --cc=shradha.t@samsung.com \
    --cc=thippeswamy.havalige@amd.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