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]
Message-ID: <20140210131557.GB1757@sirena.org.uk>
Date:	Mon, 10 Feb 2014 13:15:57 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Philipp Zabel <p.zabel@...gutronix.de>
Cc:	linux-kernel@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
	Shawn Guo <shawn.guo@...aro.org>,
	Anson Huang <b20788@...escale.com>, kernel@...gutronix.de
Subject: Re: [PATCH 1/2] regulator: anatop: Add power gating support to
 digital LDOs

On Thu, Feb 06, 2014 at 03:43:32PM +0100, Philipp Zabel wrote:
> The ARM, PU, and SOC LDOs in the i.MX6 PMU can completely gate
> their power output. Since power gating is configured by writing
> zero to the voltage target bitfield,, store a copy of the
> voltage selector to be restored when reenabling the regulator.

This is mostly good but...

>  static int anatop_regmap_set_voltage_sel(struct regulator_dev *reg,
>  					unsigned selector)
>  {
>  	struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
> +	int ret;
>  
>  	if (!anatop_reg->control_reg)
>  		return -ENOTSUPP;
>  
> -	return regulator_set_voltage_sel_regmap(reg, selector);
> +	ret = regulator_set_voltage_sel_regmap(reg, selector);
> +	if (!ret)
> +		anatop_reg->sel = selector;
> +	return ret;
>  }

...I don't understand this.  If the regulator is disabled won't this
cause it to be reenabled since we just write the stored selector in to
do that?  What I'd expect to see happening is the data being written to
the cache always and only written to the hardware if it's enabled.

> +static int anatop_regmap_disable(struct regulator_dev *reg)
> +{
> +	struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
> +
> +	if (!anatop_is_core_reg(anatop_reg))
> +		return -ENOTSUPP;
> +
> +	return regulator_set_voltage_sel_regmap(reg, LDO_POWER_GATE);
> +}

It's starting to seem like it's worth having separate ops for the core
regulator rather than all these conditionals.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ