[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AS8PR04MB84044B72EAF25185AB66EB94928CA@AS8PR04MB8404.eurprd04.prod.outlook.com>
Date: Thu, 14 Dec 2023 04:08:13 +0000
From: Sherry Sun <sherry.sun@....com>
To: Bjorn Helgaas <helgaas@...nel.org>
CC: Hongxing Zhu <hongxing.zhu@....com>,
"l.stach@...gutronix.de" <l.stach@...gutronix.de>,
"lpieralisi@...nel.org" <lpieralisi@...nel.org>,
"kw@...ux.com" <kw@...ux.com>, "robh@...nel.org" <robh@...nel.org>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH V2 1/4] PCI: imx6: Add pci host wakeup support on imx
platforms.
> -----Original Message-----
> From: Bjorn Helgaas <helgaas@...nel.org>
> Sent: 2023年12月14日 3:58
> To: Sherry Sun <sherry.sun@....com>
> Cc: Hongxing Zhu <hongxing.zhu@....com>; l.stach@...gutronix.de;
> lpieralisi@...nel.org; kw@...ux.com; robh@...nel.org;
> bhelgaas@...gle.com; krzysztof.kozlowski+dt@...aro.org;
> conor+dt@...nel.org; shawnguo@...nel.org; s.hauer@...gutronix.de;
> kernel@...gutronix.de; festevam@...il.com; dl-linux-imx <linux-
> imx@....com>; linux-pci@...r.kernel.org; linux-arm-
> kernel@...ts.infradead.org; devicetree@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH V2 1/4] PCI: imx6: Add pci host wakeup support on imx
> platforms.
>
> Drop period at the end of subject line. It only adds the possibility of
> unnecessary line wrapping in git log.
Hi Bjorn, thanks for the comments, will do in V3.
>
> On Wed, Dec 13, 2023 at 05:28:47PM +0800, Sherry Sun wrote:
> > Add pci host wakeup feature for imx platforms.
>
> s/pci/PCI/
> s/imx/i.MX/ (based on how nxp.com web pages refer to it)
>
Will do.
> > Example of configuring the corresponding dts property under the PCI
> > node:
> > wake-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
>
> Add newline between paragraphs or wrap into a single paragraph.
Will do.
>
> > + /* host wakeup support */
> > + imx6_pcie->host_wake_irq = -1;
>
> AFAIK, 0 is an invalid IRQ value. So why not drop this assignment since
> imx6_pcie->host_wake_irq is 0 by default since it was allocated with
> devm_kzalloc(), and test like this elsewhere:
>
> if (imx6_pcie->host_wake_irq) {
> enable_irq_wake(imx6_pcie->host_wake_irq)
I plan to change the host_wake_irq to unsigned int type, and add following codes, then "if (imx6_pcie->host_wake_irq)" condition seems more reasonable, let me know if you have any further suggestions. thanks!
- imx6_pcie->host_wake_irq = gpiod_to_irq(host_wake_gpio);
+ ret = gpiod_to_irq(host_wake_gpio);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to get IRQ for WAKE gpio\n");
+
+ imx6_pcie->host_wake_irq = (unsigned int)ret;
>
> > + host_wake_gpio = devm_gpiod_get_optional(dev, "wake",
> GPIOD_IN);
> > + if (IS_ERR(host_wake_gpio))
> > + return PTR_ERR(host_wake_gpio);
> > +
> > + if (host_wake_gpio != NULL) {
>
> if (host_wake_gpio)
Will do.
Best Regards
Sherry
Powered by blists - more mailing lists