From: zhangsenchuan <zhangsenchuan@eswincomputing.com>
To: "Frank Li" <Frank.li@nxp.com>, 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, jingoohan1@gmail.com,
gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
christian.bruel@foss.st.com, mayank.rana@oss.qualcomm.com,
shradha.t@samsung.com, krishna.chundru@oss.qualcomm.com,
thippeswamy.havalige@amd.com, inochiama@gmail.com,
ningyu@eswincomputing.com, linmin@eswincomputing.com,
pinkesh.vaghela@einfochips.com, ouyanghui@eswincomputing.com
Subject: Re: Re: [PATCH v5 2/2] PCI: eic7700: Add Eswin PCIe host controller driver
Date: Tue, 11 Nov 2025 11:49:24 +0800 (GMT+08:00) [thread overview]
Message-ID: <4f4d2055.77.19a71085b29.Coremail.zhangsenchuan@eswincomputing.com> (raw)
In-Reply-To: <aRJBFoRC5rm+5rHa@lizhi-Precision-Tower-5810>
> -----Original Messages-----
> From: "Frank Li" <Frank.li@nxp.com>
> Send time:Tuesday, 11/11/2025 03:46:30
> To: zhangsenchuan@eswincomputing.com
> Cc: bhelgaas@google.com, mani@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lpieralisi@kernel.org, kwilczynski@kernel.org, robh@kernel.org, p.zabel@pengutronix.de, jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, christian.bruel@foss.st.com, mayank.rana@oss.qualcomm.com, shradha.t@samsung.com, krishna.chundru@oss.qualcomm.com, thippeswamy.havalige@amd.com, inochiama@gmail.com, ningyu@eswincomputing.com, linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com, ouyanghui@eswincomputing.com
> Subject: Re: [PATCH v5 2/2] PCI: eic7700: Add Eswin PCIe host controller driver
>
> On Mon, Nov 10, 2025 at 05:09:53PM +0800, zhangsenchuan@eswincomputing.com wrote:
> > From: Senchuan Zhang <zhangsenchuan@eswincomputing.com>
> >
> > Add driver for the Eswin EIC7700 PCIe host controller, which is based on
> > the DesignWare PCIe core, IP revision 6.00a. The PCIe Gen.3 controller
> > supports a data rate of 8 GT/s and 4 channels, support INTx and MSI
> > interrupts.
> >
> > Signed-off-by: Yu Ning <ningyu@eswincomputing.com>
> > Signed-off-by: Yanghui Ou <ouyanghui@eswincomputing.com>
> > Signed-off-by: Senchuan Zhang <zhangsenchuan@eswincomputing.com>
> > ---
> > drivers/pci/controller/dwc/Kconfig | 11 +
> > drivers/pci/controller/dwc/Makefile | 1 +
> > drivers/pci/controller/dwc/pcie-eic7700.c | 420 ++++++++++++++++++++++
> > 3 files changed, 432 insertions(+)
> > create mode 100644 drivers/pci/controller/dwc/pcie-eic7700.c
> >
> > diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
> > index 349d4657393c..66568efb324f 100644
> > --- a/drivers/pci/controller/dwc/Kconfig
> > +++ b/drivers/pci/controller/dwc/Kconfig
> > @@ -93,6 +93,17 @@ config PCIE_BT1
> > Enables support for the PCIe controller in the Baikal-T1 SoC to work
> > in host mode. It's based on the Synopsys DWC PCIe v4.60a IP-core.
> >
> ...
> > +
> > +static void eic7700_pcie_pme_turn_off(struct dw_pcie_rp *pp)
> > +{
> > + struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
> > +
> > + /*
> > + * Hardware doesn't support enter the D3code and L2/L3 states, send
> > + * PME_Turn_Off message, which will then cause Vmain to be removed and
> > + * controller stop working.
> > + */
> > + dev_info(pci->dev, "Can't send PME_Turn_Off message\n");
> > +}
>
> Define a quirk to let dw_pcie_suspend_noirq() skip call pme_turn_off()
> instead do nothing here. So other driver can reuse this quirk if meet the
> similar situation.
Hi, Frank Mani
Plan:
In the dw_pcie_suspend_noirq function, add the no_suspport_L23 flag to
determine whether to skip the pme_turn_off and read_poll_timeout functions.
struct dw_pcie {
...........
bool no_suspport_L23;
}
if (pci->no_suspport_L23)
goto skip_L23;
.......
skip_L23:
dw_pcie_stop_link(pci);
if (pci->pp.ops->deinit)
pci->pp.ops->deinit(&pci->pp);
This submission is also skipping pme_turn_off and read_poll_timeout, the above also
controls the same code. Could it be considered to merge the above code, so other
driver can reuse this flag if meet the similar situation. Or there are other better
ways to solve this problem?
https://lore.kernel.org/linux-pci/aRISPgCZyEZxStIN@lizhi-Precision-Tower-5810/#t
Looking forward to your reply. Thank you very much!
Kind regards,
Senchuan Zhang
>
> And use quirk to know hardware limistion easily.
>
> Do you know why controller stop working if vmain be removed. Suppose resume
> will reinit host controller at resume.
Through testing, if vmain be removed and controller stop working, the dbi
register shows that it cannot be accesseded. The link state cannot be read
in the read_poll_timeout function.
>
> > +
> > +static const struct dw_pcie_host_ops eic7700_pcie_host_ops = {
> > + .init = eic7700_pcie_host_init,
> > + .deinit = eic7700_pcie_host_deinit,
> > + .pme_turn_off = eic7700_pcie_pme_turn_off,
> > +};
> > +
> ...
> > 2.25.1
> >
prev parent reply other threads:[~2025-11-11 3:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 9:07 [PATCH v5 0/2] Add driver support for Eswin EIC7700 SoC PCIe controller zhangsenchuan
2025-11-10 9:08 ` [PATCH v5 1/2] dt-bindings: PCI: eic7700: Add Eswin PCIe host controller zhangsenchuan
2025-11-10 9:09 ` [PATCH v5 2/2] PCI: eic7700: Add Eswin PCIe host controller driver zhangsenchuan
2025-11-10 19:46 ` Frank Li
2025-11-11 3:49 ` zhangsenchuan [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=4f4d2055.77.19a71085b29.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=gustavo.pimentel@synopsys.com \
--cc=inochiama@gmail.com \
--cc=jingoohan1@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=mayank.rana@oss.qualcomm.com \
--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;
as well as URLs for NNTP newsgroup(s).