Re: Regulator probe

From: Andy Shevchenko
Date: Fri Sep 09 2016 - 08:55:36 EST


On Fri, 2016-09-09 at 13:17 +0100, Mark Brown wrote:
> On Wed, Sep 07, 2016 at 05:24:01PM +0300, Andy Shevchenko wrote:
> >
> > On Tue, 2016-09-06 at 11:24 +0100, Mark Brown wrote:
>
> >
> > >
> > > Nothing says you have to describe all regulators, you just need to
> > > tell the core you have told it about everything you're going to
> > > tell
> > > it about.ÂÂUntil you do that the core has to assume that something
> > > may
> > > come along later and describe that supply.
>
> >
> > That's I would like to make work. For now we have fixed voltage
> > regulator which returns EPROBE_DEFER since GPIO IP is not
> > initialized
> > yet at that point. But regulator framework decides that it's not
> > possible case and overrides the error code.
>
> What do you mean?ÂÂOf course we should handle probe deferral if we
> fail to get a resource like a GPIO.ÂÂAre you trying to say that this
> doesn't work for you?

No, it doesn't.

Fixed regulator probe is deferred:

reg-fixed-voltage reg-fixed-voltage.0.auto: Failed to register
regulator: -517

But:
sdhci-pci 0000:00:01.3: No vmmc regulator found

Code in sdhci driver is:
    ret = mmc_regulator_get_supply(mmc);
ÂÂÂÂÂÂÂÂif (ret == -EPROBE_DEFER)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn ret;

mmc_regulator_get_supply():
...
    mmc->supply.vmmc = devm_regulator_get_optional(dev, "vmmc");
ÂÂÂÂÂÂÂÂmmc->supply.vqmmc = devm_regulator_get_optional(dev, "vqmmc");

ÂÂÂÂÂÂÂÂif (IS_ERR(mmc->supply.vmmc)) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn -EPROBE_DEFER;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdev_dbg(dev, "No vmmc regulator found\n");
...


So _regulator_get() returns something else than -EPROBE_DEFER.


--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy