lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 3 Nov 2020 01:59:39 +0100
From:   Ondřej Jirman <megous@...ous.com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Corentin Labbe <clabbe.montjoie@...il.com>,
        Ahmad Fatoum <a.fatoum@...gutronix.de>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH v1] regulator: defer probe when trying to get voltage
 from unresolved supply

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 <megous@...ous.com>

thank you very much,
	Ondrej

> Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
> Cc: stable@...r.kernel.org
> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> Reported-by: Ondřej Jirman <megous@...ous.com>
> Reported-by: Corentin Labbe <clabbe.montjoie@...il.com>
> ---
>  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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ