Re: Re: [PATCH v7 2/3] PCI: eic7700: Add Eswin PCIe host controller driver

From: zhangsenchuan

Date: Thu Dec 11 2025 - 07:10:57 EST





> -----Original Messages-----
> From: "Bjorn Helgaas" <helgaas@xxxxxxxxxx>
> Send time:Thursday, 11/12/2025 00:43:27
> To: zhangsenchuan@xxxxxxxxxxxxxxxxxx
> Cc: bhelgaas@xxxxxxxxxx, mani@xxxxxxxxxx, krzk+dt@xxxxxxxxxx, conor+dt@xxxxxxxxxx, lpieralisi@xxxxxxxxxx, kwilczynski@xxxxxxxxxx, robh@xxxxxxxxxx, p.zabel@xxxxxxxxxxxxxx, jingoohan1@xxxxxxxxx, gustavo.pimentel@xxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, christian.bruel@xxxxxxxxxxx, mayank.rana@xxxxxxxxxxxxxxxx, shradha.t@xxxxxxxxxxx, krishna.chundru@xxxxxxxxxxxxxxxx, thippeswamy.havalige@xxxxxxx, inochiama@xxxxxxxxx, Frank.li@xxxxxxx, ningyu@xxxxxxxxxxxxxxxxxx, linmin@xxxxxxxxxxxxxxxxxx, pinkesh.vaghela@xxxxxxxxxxxxxx, ouyanghui@xxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v7 2/3] PCI: eic7700: Add Eswin PCIe host controller driver
>
> On Tue, Dec 02, 2025 at 05:04:06PM +0800, zhangsenchuan@xxxxxxxxxxxxxxxxxx wrote:
> > From: Senchuan Zhang <zhangsenchuan@xxxxxxxxxxxxxxxxxx>
> >
> > Add driver for the Eswin EIC7700 PCIe host controller, which is based on
> > the DesignWare PCIe core, IP revision 5.96a. The PCIe Gen.3 controller
> > supports a data rate of 8 GT/s and 4 channels, support INTx and MSI
> > interrupts.
>
> > +static int eic7700_pcie_host_init(struct dw_pcie_rp *pp)
> > ...
> > + /*
> > + * The PWR and DBI Reset signals are respectively used to reset the
> > + * PCIe controller and the DBI registers.
> > + * The PERST# signal is a reset signal that simultaneously controls the
> > + * PCIe controller, PHY, and Endpoint.
> > + * Before configuring the PHY, the PERST# signal must first be
> > + * deasserted.
> > + * The external reference clock is supplied simultaneously to the PHY
> > + * and EP. When the PHY is configurable, the entire chip already has
> > + * stable power and reference clock.
> > + * The PHY will be ready within 20ms after writing app_hold_phy_rst
> > + * register of ELBI register space.
>
> Add blank lines between paragraphs.
>
> > +static int eic7700_pcie_probe(struct platform_device *pdev)
> > ...
> > + pci->no_pme_handshake = pcie->data->no_pme_handshake;
>
> This needs to go in the 3/3 "PCI: dwc: Add no_pme_handshake flag and
> skip PME_Turn_Off broadcast" patch because "no_pme_handshake" doesn't
> exist yet so this patch doesn't build by itself.

Hi, Bjorn

Thanks for your comment.
Do I need to adjust the order of the patches?
3/2 "PCI: dwc: Add no_pme_handshake flag and skip PME_Turn_Off broadcast"
3/3 "PCI: eic7700: Add Eswin PCIe host controller driver"

Or merge Patch 2/3 and Patch 3/3?

Kind regards,
Senchuan Zhang
>
> > +static const struct dev_pm_ops eic7700_pcie_pm_ops = {
> > + NOIRQ_SYSTEM_SLEEP_PM_OPS(eic7700_pcie_suspend_noirq,
> > + eic7700_pcie_resume_noirq)
> > +};
>
> Use DEFINE_NOIRQ_DEV_PM_OPS() instead. The collection of PM-related
> macros is confusing to say the least, and they're not used
> consistently across the PCIe drivers, but I *think* the rule of thumb
> should be:
>
> Prefer DEFINE_NOIRQ_DEV_PM_OPS() over NOIRQ_SYSTEM_SLEEP_PM_OPS()
> when possible and omit pm_sleep_ptr() and pm_ptr().

Okey, thanks.
I will use the following combination:
DEFINE_NOIRQ_DEV_PM_OPS(eic7700_pcie_pm, eic7700_pcie_suspend_noirq,
eic7700_pcie_resume_noirq);
.pm = &eic7700_pcie_pm,