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: <20181107145349.GA6809@sirena.org.uk>
Date:   Wed, 7 Nov 2018 14:53:49 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Claudiu.Beznea@...rochip.com
Cc:     lgirdwood@...il.com, Nicolas.Ferre@...rochip.com,
        alexandre.belloni@...tlin.com, robh+dt@...nel.org,
        mark.rutland@....com, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
        boris.brezillon@...tlin.com
Subject: Re: [PATCH 1/2] regulator: act8945: Implement PM functionalities

On Fri, Oct 26, 2018 at 04:19:48PM +0000, Claudiu.Beznea@...rochip.com wrote:

> +static unsigned int act8945a_of_map_mode(unsigned int mode)
> +{
> +	if (mode == ACT8945A_DCDC_MODE_POWER_SAVING)
> +		return REGULATOR_MODE_STANDBY;
> +
> +	return REGULATOR_MODE_NORMAL;
> +}

This should error out if it gets an unknown value rather than silently
mapping it to normal - we don't know what the user intended to set here.
There should also be some binding documentation updates saying what the
values that can be set are.

> +static void act8945a_pmic_shutdown(struct platform_device *pdev)
> +{
> +	struct act8945a_pmic *act8945a = platform_get_drvdata(pdev);
> +	struct regmap *regmap = act8945a->regmap;
> +
> +	/*
> +	 * Ask the PMIC to shutdown everything on the next PWRHLD transition.
> +	 */
> +	regmap_write(regmap, ACT8945A_SYS_CTRL, 0x0);
>  }
>  

This shutdown function appears to be independant of the mode setting and
would be better split out as a separate patch (you could have one patch
adding the regmap stuff, one for this and one for the mode setting).
It makes review a lot simpler if each patch does a minimal set of
changes.

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