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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 24 Apr 2016 23:51:27 +0100
From:	Mark Brown <broonie@...nel.org>
To:	WEN Pingbo <pingbo.wen@...aro.org>
Cc:	linux-kernel@...r.kernel.org, lgirdwood@...il.com,
	vincent.guittot@...aro.org, stephen.boyd@...aro.org
Subject: Re: [RFC PATCH 2/2] regulator: add boot protection flag

On Sat, Apr 23, 2016 at 03:11:06PM +0800, WEN Pingbo wrote:

> This patch try to add a boot_protection flag in regulator constraints.
> So the regulator core will prevent the specified operation during kernel
> booting.

> The boot_protection flag only work before late_initicall. And as other
> constraints liked, you can specify this flag in a board file, or in
> dts file. By default, all operations of this regulator will be rejected
> during kernel booting, if you add this flag in a regulator. But you
> still have a chance to change this, by modifying boot_valid_ops_mask.

This is still a complete hack which is going to break as soon as things
are built modular, it's definitely *not* something that should ever
appear in DT since it depends so heavily on implementation details.  If
you need some driver to start early work on getting that sorted.

This is also going to interact badly with any other drivers that are
trying to configure things at runtime, if they've done enables and
disables (or especially an enable without a matching disable) their
refcounts are going to be wrong and if they've tried to do anything with
setting voltages we'll have completely ignored whatever they asked for
or told them that they can't change voltages.  If we were doing anything
like this it would need to be a lot more transparent to other
regulators sharing the supplies (which are presumably what's causing
problems here).

> [ This patch depends on regulator_ops_is_valid patch. And some document
> need to add, but I want to hear some voice first. ]

There is no need to say that patch 2 in a series depends on patch 1.

> @@ -868,7 +877,7 @@ static void print_constraints(struct regulator_dev *rdev)
>  	rdev_dbg(rdev, "%s\n", buf);
>  
>  	if ((constraints->min_uV != constraints->max_uV) &&
> -	    !regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE))
> +	    !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE))
>  		rdev_warn(rdev,
>  			  "Voltage range but no REGULATOR_CHANGE_VOLTAGE\n");
>  }

This appears to be unrelated?

> +	if (constraints->boot_protection) {
> +		if (of_property_read_bool(np, "boot-allow-set-voltage"))
> +			constraints->boot_valid_ops_mask |=
> +				REGULATOR_CHANGE_VOLTAGE;

We were factoring things out a minute ago...

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ