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] [day] [month] [year] [list]
Date:   Wed, 29 Nov 2017 18:29:45 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Maciej Purski <m.purski@...sung.com>
Cc:     linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        Liam Girdwood <lgirdwood@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [RFC PATCH v2 3/3] regulator: core: Balance coupled regulators
 voltages

On Wed, Oct 18, 2017 at 02:47:02PM +0200, Maciej Purski wrote:

> +static void regulator_lock_supply_parents(struct regulator_dev *rdev)
> +{
> +	struct regulator_dev *supply = rdev_get_supply(rdev);
> +
> +	if (supply)
> +		regulator_lock_supply(supply);
> +}

These functions are fairly pointless as they're so small, and they're
misnamed as they only lock a single parent but the name suggests it's
going to lock multiple things (I'd expect all the coupled regulators or
something from the name).

> +	/*
> +	 * If the regulator is coupled with other regulators, we have to
> +	 * balance their voltages to keep the max_spread constraint.
> +	 */
> +	if (rdev->coupled_desc)
> +		regulator_balance_coupled(rdev->coupled_desc);

Just put the check into regulator_balance_coupled() rather than doing it
at every call site.

> +	/*
> +	 * If the regulator is coupled, return after changing consumer demands
> +	 * without changing voltage. This will be handled outside the function
> +	 * by regulator_balance_coupled()
> +	 */
> +	if (rdev->coupled_desc)
> +		goto out;
> +
> +	ret = regulator_set_voltage_rdev(regulator->rdev, min_uV, max_uV);
> +	if (ret < 0)
> +		goto out2;

Where is the elsewhere?  I'm worried this is going to make things more
confusing.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ