Hello Michal,

On Mon, Nov 02, 2020 at 10:27:27PM +0100, Michał Mirosław wrote:
> regulator_get_voltage_rdev() is called in regulator probe() when
> applying machine constraints.  The "fixed" commit exposed the problem
> that non-bypassed regulators can forward the request to its parent
> (like bypassed ones) supply. Return -EPROBE_DEFER when the supply
> is expected but not resolved yet.
> 

Tested-by: Ondřej Jirman <[email protected]>

thank you very much,
        Ondrej

> Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
> Cc: [email protected]
> Signed-off-by: Michał Mirosław <[email protected]>
> Reported-by: Ondřej Jirman <[email protected]>
> Reported-by: Corentin Labbe <[email protected]>
> ---
>  v1: this is a bit different solution than the hack sent earlier. It should
>      be equivalent (putting the error code at the source), but please
>      test again.
> ---
>  drivers/regulator/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index a4ffd71696da..a5ad553da8cd 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -4165,6 +4165,8 @@ int regulator_get_voltage_rdev(struct regulator_dev 
> *rdev)
>               ret = rdev->desc->fixed_uV;
>       } else if (rdev->supply) {
>               ret = regulator_get_voltage_rdev(rdev->supply->rdev);
> +     } else if (rdev->supply_name) {
> +             return -EPROBE_DEFER;
>       } else {
>               return -EINVAL;
>       }
> -- 
> 2.20.1
> 

Reply via email to