From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
John Stultz <john.stultz@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC 09/10] misc: hisi_hikey_usb: add support for Hikey 970
Date: Fri, 4 Sep 2020 15:47:15 +0200 [thread overview]
Message-ID: <20200904154715.70cba0d3@coco.lan> (raw)
In-Reply-To: <20200904124523.GE4625@sirena.org.uk>
Em Fri, 4 Sep 2020 13:45:23 +0100
Mark Brown <broonie@kernel.org> escreveu:
> On Fri, Sep 04, 2020 at 02:38:48PM +0200, Mauro Carvalho Chehab wrote:
> > Em Fri, 4 Sep 2020 13:23:03 +0100
> > Mark Brown <broonie@kernel.org> escreveu:
> >
> > > On Fri, Sep 04, 2020 at 12:23:31PM +0200, Mauro Carvalho Chehab wrote:
> > >
> > > > + regulator = devm_regulator_get_optional(&pdev->dev, "hub-vdd");
> > > > + if (IS_ERR(regulator)) {
> > > > + if (PTR_ERR(regulator) == -EPROBE_DEFER) {
> > > > + dev_info(&pdev->dev,
> > > > + "waiting for hub-vdd-supply to be probed\n");
> > > > + return PTR_ERR(regulator);
> > > > + }
> > > > +
> > > > + /* let it fall back to regulator dummy */
> > > > + regulator = devm_regulator_get(&pdev->dev, "hub-vdd");
> > > > + if (IS_ERR(regulator)) {
> > > > + dev_err(&pdev->dev,
> > > > + "get hub-vdd-supply failed with error %ld\n",
> > > > + PTR_ERR(regulator));
> > > > + return PTR_ERR(regulator);
> > > > + }
> > > > + }
>
> > > This seems weird - if the supply is non-optional why is the code trying
> > > with devm_regulator_get_optional()? Just use normal get directly.
>
> > That's meant to avoid problems with EPROBE_DEFER.
>
> Which problems and in what way does it avoid them?
>
> > See, Hikey 970 need to initialize 4 drivers for the regulators:
> > SPMI core, SPMI bus controller, MFD and regulator. This can take
> > some time. So, a first call to *regulator_get() may return
> > EPROBE_DEFER, specially if both regulator drivers and USB HUB
> > are builtin.
>
> This is totally normal and works fine with normal regulator_get().
When I was porting the drm driver (first from OOT Kernel 4.9 to 4.19.5,
and then from 4.19.5 to 5.7), I'm pretty sure I got several of those
messages:
"supply %s not found, using dummy regulator\n"
due to EPROBE_DEFER. I remember I ended checked the implementation
of the regulator code on that time. Yet, looking at the current
implementation of _regulator_get():
rdev = regulator_dev_lookup(dev, id);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
I see that devm_regulator_get() will do the right thing with
EPROBE_DEFER.
So, I'll replace it at the driver. Thanks for the review!
Thanks,
Mauro
next prev parent reply other threads:[~2020-09-04 13:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 10:23 [RFC 00/10] Add USB support for Hikey 970 Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 01/10] phy: hisilicon: add USB physical layer for Kirin 3670 Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 02/10] phy: hisilicon: phy-hi3670-usb3: fix some issues at the init code Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 03/10] phy: hisilicon: phy-hi3670-usb3: use a consistent namespace Mauro Carvalho Chehab
2020-09-09 20:15 ` Rob Herring
2020-09-10 5:37 ` Mauro Carvalho Chehab
2020-09-15 16:51 ` Rob Herring
2020-09-04 10:23 ` [RFC 04/10] phy: hisilicon: phy-hi3670-usb3: fix coding style Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 05/10] phy: hisilicon: phy-hi3670-usb3: change some DT properties Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 06/10] dt-bindings: phy: convert phy-kirin970-usb3.txt to yaml Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 07/10] MAINTAINERS: add myself as maintainer for Kirin 970 USB PHY Mauro Carvalho Chehab
2020-09-04 10:23 ` [RFC 08/10] misc: hisi_hikey_usb: Driver to support onboard USB gpio hub on Hikey960 Mauro Carvalho Chehab
2020-09-04 12:53 ` Randy Dunlap
2020-09-04 10:23 ` [RFC 09/10] misc: hisi_hikey_usb: add support for Hikey 970 Mauro Carvalho Chehab
2020-09-04 12:23 ` Mark Brown
2020-09-04 12:38 ` Mauro Carvalho Chehab
2020-09-04 12:45 ` Mark Brown
2020-09-04 13:47 ` Mauro Carvalho Chehab [this message]
2020-09-04 10:23 ` [RFC 10/10] dts: hisilicon: add support for USB3 on " Mauro Carvalho Chehab
2020-09-04 10:53 ` [RFC 00/10] Add USB support for " Robin Murphy
2020-09-04 12:28 ` Mauro Carvalho Chehab
2020-09-04 12:34 ` Mark Brown
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=20200904154715.70cba0d3@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mani@kernel.org \
--cc=mauro.chehab@huawei.com \
--cc=robin.murphy@arm.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