From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
"Lukas F . Hartmann" <lukas@mntmn.com>,
Lucas Stach <l.stach@pengutronix.de>,
Ulf Hansson <ulf.hansson@linaro.org>,
Richard Zhu <hongxing.zhu@nxp.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] PCI: imx: Fix probe failure without power domain
Date: Tue, 22 Jan 2019 08:12:51 +0100 [thread overview]
Message-ID: <20190122071251.tgdwnunxksa45n5q@pengutronix.de> (raw)
In-Reply-To: <375a852ae9170a5f8f53fdd364a7fb7ea642e89c.1548110502.git.leonard.crestez@nxp.com>
On Mon, Jan 21, 2019 at 10:50:04PM +0000, Leonard Crestez wrote:
> On chips without a separate power domain for PCI (such as 6q/6qp) the
> imx6_pcie_attach_pd function incorrectly returns an error.
>
> Fix by returning 0 if dev_pm_domain_attach_by_name doesn't find
> anything.
>
> Fixes: 3f7cceeab895 ("PCI: imx: Add multi-pd support")
> Reported-by: Lukas F.Hartmann <lukas@mntmn.com>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---
> drivers/pci/controller/dwc/pci-imx6.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 52e47dac028f..ac5f6ae0b254 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -308,10 +308,13 @@ static int imx6_pcie_attach_pd(struct device *dev)
> return 0;
>
> imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie");
> if (IS_ERR(imx6_pcie->pd_pcie))
> return PTR_ERR(imx6_pcie->pd_pcie);
> + /* Do nothing when power domain missing */
> + if (!imx6_pcie->pd_pcie)
> + return 0;
As I said in the mail that proposed this patch for testing: I think it
would be better to change dev_pm_domain_attach_by_name to not return an
error indication by returning NULL or an ERR_PTR value. (Or change
device_link_add to accept NULL if NULL is a dummy value.)
Just repeating it here to have it near the actual patch.
Best regards
Uwe
> link = device_link_add(dev, imx6_pcie->pd_pcie,
> DL_FLAG_STATELESS |
> DL_FLAG_PM_RUNTIME |
> DL_FLAG_RPM_ACTIVE);
> if (!link) {
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2019-01-22 7:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 22:50 [PATCH 0/2] PCI: imx: imx6_pcie_attach_pd Leonard Crestez
2019-01-21 22:50 ` [PATCH 1/2] PCI: imx: Fix probe failure without power domain Leonard Crestez
2019-01-22 7:12 ` Uwe Kleine-König [this message]
2019-01-22 9:17 ` Leonard Crestez
2019-01-22 9:44 ` Uwe Kleine-König
2019-01-22 9:52 ` Leonard Crestez
2019-01-21 22:50 ` [PATCH 2/2] PCI: imx: Fix checking pd_pcie_phy device_link Leonard Crestez
2019-01-25 17:59 ` [PATCH 0/2] PCI: imx: imx6_pcie_attach_pd Lorenzo Pieralisi
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=20190122071251.tgdwnunxksa45n5q@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=hongxing.zhu@nxp.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=lukas@mntmn.com \
--cc=shawnguo@kernel.org \
--cc=ulf.hansson@linaro.org \
/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).