[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <xmjgs5ssolugcq2ogjc5j3ccwalcc4q3whl64fcra2aiebhtci@qwobbjtb2wcl>
Date: Mon, 29 Sep 2025 22:02:27 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: chester62515@...il.com, mbrugger@...e.com,
ghennadi.procopciuc@....nxp.com, s32@....com, bhelgaas@...gle.com, jingoohan1@...il.com,
lpieralisi@...nel.org, kwilczynski@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, Ionut.Vicovan@....com, larisa.grigore@....com,
Ghennadi.Procopciuc@....com, ciprianmarian.costea@....com, bogdan.hamciuc@....com,
Frank.li@....com, linux-arm-kernel@...ts.infradead.org, linux-pci@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, imx@...ts.linux.dev,
cassel@...nel.org
Subject: Re: [PATCH 2/3 v2] PCI: s32g: Add initial PCIe support (RC)
On Mon, Sep 29, 2025 at 06:23:05PM +0200, Vincent Guittot wrote:
[...]
> > > > > +static int s32g_pcie_resume(struct device *dev)
> > > > > +{
> > > > > + struct s32g_pcie *s32g_pp = dev_get_drvdata(dev);
> > > > > + struct dw_pcie *pci = &s32g_pp->pci;
> > > > > + struct dw_pcie_rp *pp = &pci->pp;
> > > > > + int ret = 0;
> > > > > +
> > > > > + ret = s32g_pcie_init(dev, s32g_pp);
> > > > > + if (ret < 0)
> > > > > + return ret;
> > > > > +
> > > > > + ret = dw_pcie_setup_rc(pp);
> > > > > + if (ret) {
> > > > > + dev_err(dev, "Failed to resume DW RC: %d\n", ret);
> > > > > + goto fail_host_init;
> > > > > + }
> > > > > +
> > > > > + ret = dw_pcie_start_link(pci);
> > > > > + if (ret) {
> > > > > + /*
> > > > > + * We do not exit with error if link up was unsuccessful
> > > > > + * Endpoint may not be connected.
> > > > > + */
> > > > > + if (dw_pcie_wait_for_link(pci))
> > > > > + dev_warn(pci->dev,
> > > > > + "Link Up failed, Endpoint may not be connected\n");
> > > > > +
> > > > > + if (!phy_validate(s32g_pp->phy, PHY_MODE_PCIE, 0, NULL)) {
> > > > > + dev_err(dev, "Failed to get link up with EP connected\n");
> > > > > + goto fail_host_init;
> > > > > + }
> > > > > + }
> > > > > +
> > > > > + ret = pci_host_probe(pp->bridge);
> > > >
> > > > Oh no... Do not call pci_host_probe() directly from glue drivers. Use
> > > > dw_pcie_host_init() to do so. This should simplify suspend and resume functions.
> > >
> > > dw_pcie_host_init() is doing much more than just init the controller
> > > as it gets resources which we haven't released during suspend.
> > >
> >
> > Any specific reason to keep resources enabled, even though you were removing the
> > Root bus? This doesn't make sense to me.
>
> By ressources I mean everything before dw_pcie_setup_rc() in
> dw_pcie_host_init() which are still there after dw_pcie_host_deinit()
> in addition to being a waste of time. Also we don't need to remove
> edma and free msi
>
Let me take a step back and ask, why do you need to remove Root bus during
suspend() and not just disable LTSSM with dw_pcie_stop_link()?
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists