mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sherry Sun <sherry.sun@nxp.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Hongxing Zhu <hongxing.zhu@nxp.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	Frank Li <frank.li@nxp.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
	"kwilczynski@kernel.org" <kwilczynski@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH V8 05/13] PCI: imx6: Add support for parsing the reset property in new Root Port binding
Date: Tue, 17 Mar 2026 09:09:26 +0000	[thread overview]
Message-ID: <VI0PR04MB121148F11CDB5EB4ED89ACA949241A@VI0PR04MB12114.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <tot7suhdkydo5er4zjcxkdvfalii7k72kqyw54o5frtoklkxif@l6x6ipaezlmq>

> On Fri, Mar 13, 2026 at 10:08:15AM +0800, Sherry Sun wrote:
> > The current DT binding for pci-imx6 specifies the 'reset-gpios'
> > property in the host bridge node. However, the PERST# signal logically
> > belongs to individual Root Ports rather than the host bridge itself.
> > This becomes important when supporting PCIe KeyE connector and PCI
> > power control framework for pci-imx6 driver, which requires properties
> > to be specified in Root Port nodes.
> >
> > With the common Root Port parsing now handled in dw_pcie_host_init(),
> > update the reset GPIO handling to use the parsed port list from
> > bridge->ports. To maintain DT backwards compatibility, fallback to the
> > legacy method of parsing the host bridge node if the reset property is
> > not present in the Root Port node (indicated by an empty ports list).
> >
> > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > ---
> >  drivers/pci/controller/dwc/pci-imx6.c | 74
> > +++++++++++++++++++++------
> >  1 file changed, 59 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c
> > b/drivers/pci/controller/dwc/pci-imx6.c
> > index 83beca5a1fc2..cb18e1579788 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -34,6 +34,7 @@
> >  #include <linux/pm_runtime.h>
> >
> >  #include "../../pci.h"
> > +#include "../pci-host-common.h"
> >  #include "pcie-designware.h"
> >
> >  #define IMX8MQ_GPR_PCIE_REF_USE_PAD		BIT(9)
> > @@ -150,7 +151,6 @@ struct imx_lut_data {
> >
> >  struct imx_pcie {
> >  	struct dw_pcie		*pci;
> > -	struct gpio_desc	*reset_gpiod;
> >  	struct clk_bulk_data	*clks;
> >  	int			num_clks;
> >  	bool			supports_clkreq;
> > @@ -1222,6 +1222,44 @@ static void imx_pcie_disable_device(struct
> pci_host_bridge *bridge,
> >  	imx_pcie_remove_lut(imx_pcie, pci_dev_id(pdev));  }
> >
> > +static int imx_pcie_parse_legacy_binding(struct imx_pcie *pcie) {
> > +	struct device *dev = pcie->pci->dev;
> > +	struct pci_host_bridge *bridge = pcie->pci->pp.bridge;
> > +	struct pci_host_port *port;
> > +	struct gpio_desc *reset;
> > +
> > +	if (!bridge) {
> > +		dev_err(dev, "Bridge not allocated yet\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	/*
> > +	 * For DT backward compatibility: if no Root Port nodes were parsed
> > +	 * (indicated by empty ports list), parse reset-gpios from the host
> > +	 * bridge node.
> > +	 */
> > +	if (!list_empty(&bridge->ports))
> 
> You should move this check and the comment to imx_pcie_host_init() and call
> imx_pcie_parse_legacy_binding() conditionally to make it clear that this is a
> fallback.
> 

Ok, thanks for the suggestion, will do this in V9.

Best Regards
Sherry

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

  reply	other threads:[~2026-03-17  9:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13  2:08 [PATCH V8 00/13] pci-imx6: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 01/13] dt-bindings: PCI: fsl,imx6q-pcie: Add reset GPIO in Root Port node Sherry Sun
2026-03-13  2:08 ` [PATCH V8 02/13] PCI: host-generic: Add common helpers for parsing Root Port properties Sherry Sun
2026-03-16  5:40   ` Manivannan Sadhasivam
2026-03-17  8:01     ` Sherry Sun
2026-03-17  9:51       ` Manivannan Sadhasivam
2026-03-17 10:35         ` Sherry Sun
2026-03-13  2:08 ` [PATCH V8 03/13] PCI: dwc: Parse Root Port nodes in dw_pcie_host_init() Sherry Sun
2026-03-16  5:56   ` Manivannan Sadhasivam
2026-03-17  9:04     ` Sherry Sun
2026-03-17  9:58       ` Manivannan Sadhasivam
2026-03-13  2:08 ` [PATCH V8 04/13] PCI: imx6: Assert PERST# before enabling regulators Sherry Sun
2026-03-13  2:08 ` [PATCH V8 05/13] PCI: imx6: Add support for parsing the reset property in new Root Port binding Sherry Sun
2026-03-16  6:04   ` Manivannan Sadhasivam
2026-03-17  9:09     ` Sherry Sun [this message]
2026-03-13  2:08 ` [PATCH V8 06/13] arm: dts: imx6qdl: Add Root Port node and PERST property Sherry Sun
2026-03-13  6:08   ` Chen-Yu Tsai
2026-03-13  7:16     ` Sherry Sun
2026-03-16  5:30     ` Manivannan Sadhasivam
2026-03-17  8:14       ` Sherry Sun
2026-03-13  2:08 ` [PATCH V8 07/13] arm: dts: imx6sx: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 08/13] arm: dts: imx7d: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 09/13] arm64: dts: imx8mm: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 10/13] arm64: dts: imx8mp: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 11/13] arm64: dts: imx8mq: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 12/13] arm64: dts: imx8dxl/qm/qxp: " Sherry Sun
2026-03-13  2:08 ` [PATCH V8 13/13] arm64: dts: imx95: " Sherry Sun

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=VI0PR04MB121148F11CDB5EB4ED89ACA949241A@VI0PR04MB12114.eurprd04.prod.outlook.com \
    --to=sherry.sun@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=hongxing.zhu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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

all inboxes | Powered by JetHome®