devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Marc Zyngier <maz@kernel.org>, PCI <linux-pci@vger.kernel.org>,
	devicetree@vger.kernel.org,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [PATCH v6 6/6] PCI: uniphier: Add error message when failed to get phy
Date: Thu, 3 Sep 2020 16:25:33 -0600	[thread overview]
Message-ID: <CAL_JsqKQ-jwgUst1PLM1jnoo8hiAap=D2jhKP-Z9YktiUgrU_g@mail.gmail.com> (raw)
In-Reply-To: <aadb805d-e5fb-438a-d7e1-4e1ad31ddbac@socionext.com>

On Fri, Aug 21, 2020 at 1:05 AM Kunihiko Hayashi
<hayashi.kunihiko@socionext.com> wrote:
>
> On 2020/08/18 1:39, Rob Herring wrote:
> > On Fri, Aug 7, 2020 at 4:25 AM Kunihiko Hayashi
> > <hayashi.kunihiko@socionext.com> wrote:
> >>
> >> Even if phy driver doesn't probe, the error message can't be distinguished
> >> from other errors. This displays error message caused by the phy driver
> >> explicitly.
> >>
> >> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> >> ---
> >>   drivers/pci/controller/dwc/pcie-uniphier.c | 8 ++++++--
> >>   1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/pci/controller/dwc/pcie-uniphier.c b/drivers/pci/controller/dwc/pcie-uniphier.c
> >> index 93ef608..7c8721e 100644
> >> --- a/drivers/pci/controller/dwc/pcie-uniphier.c
> >> +++ b/drivers/pci/controller/dwc/pcie-uniphier.c
> >> @@ -489,8 +489,12 @@ static int uniphier_pcie_probe(struct platform_device *pdev)
> >>                  return PTR_ERR(priv->rst);
> >>
> >>          priv->phy = devm_phy_optional_get(dev, "pcie-phy");
> >
> > The point of the optional variant vs. devm_phy_get() is whether or not
> > you get an error message. So shouldn't you switch to devm_phy_get
> > instead?
> >
> >> -       if (IS_ERR(priv->phy))
> >> -               return PTR_ERR(priv->phy);
> >> +       if (IS_ERR(priv->phy)) {
> >> +               ret = PTR_ERR(priv->phy);
> >> +               if (ret != -EPROBE_DEFER)
> >> +                       dev_err(dev, "Failed to get phy (%d)\n", ret);
> >> +               return ret;
> >> +       }
>
> The 'phys' property is optional, so if there isn't 'phys' in the PCIe node,
> devm_phy_get() returns -ENODEV, and devm_phy_optional_get() returns NULL.
>
> When devm_phy_optional_get() replaces devm_phy_get(),
> condition for displaying an error message changes to:
>
>     (ret != -EPROBE_DEFER && ret != -ENODEV)
>
> This won't be simple, but should it be replaced?

Nevermind. I was thinking we had some error prints for the optional
vs. non-optional variants.

Rob

  reply	other threads:[~2020-09-03 22:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 10:25 [PATCH v6 0/6] PCI: uniphier: Add features for UniPhier PCIe host controller Kunihiko Hayashi
2020-08-07 10:25 ` [PATCH v6 1/6] PCI: portdrv: Add pcie_port_service_get_irq() function Kunihiko Hayashi
2020-08-07 10:25 ` [PATCH v6 2/6] PCI: dwc: Add msi_host_isr() callback Kunihiko Hayashi
2020-09-10 18:20   ` Rob Herring
2020-08-07 10:25 ` [PATCH v6 3/6] PCI: uniphier: Add misc interrupt handler to invoke PME and AER Kunihiko Hayashi
2020-08-07 10:25 ` [PATCH v6 4/6] dt-bindings: PCI: uniphier: Add iATU register description Kunihiko Hayashi
2020-08-07 10:25 ` [PATCH v6 5/6] PCI: uniphier: Add iATU register support Kunihiko Hayashi
2020-08-17 16:48   ` Rob Herring
2020-08-21  7:05     ` Kunihiko Hayashi
2020-09-03 22:12       ` Rob Herring
2020-09-07 16:09         ` Kunihiko Hayashi
2020-08-07 10:25 ` [PATCH v6 6/6] PCI: uniphier: Add error message when failed to get phy Kunihiko Hayashi
2020-08-17 16:39   ` Rob Herring
2020-08-21  7:05     ` Kunihiko Hayashi
2020-09-03 22:25       ` Rob Herring [this message]
2020-09-07 16:09         ` Kunihiko Hayashi
2020-09-10 18:24   ` Rob Herring

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='CAL_JsqKQ-jwgUst1PLM1jnoo8hiAap=D2jhKP-Z9YktiUgrU_g@mail.gmail.com' \
    --to=robh+dt@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=jingoohan1@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=masami.hiramatsu@linaro.org \
    --cc=maz@kernel.org \
    --cc=yamada.masahiro@socionext.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).