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:   Wed, 2 May 2018 12:57:10 +0200
From:   Sebastian Reichel <sebastian.reichel@...labora.co.uk>
To:     Enric Balletbo i Serra <enric.balletbo@...labora.com>
Cc:     Lee Jones <lee.jones@...aro.org>,
        Gwendal Grignou <gwendal@...omium.org>,
        Sameer Nanda <snanda@...omium.org>, linux-pm@...r.kernel.org,
        Guenter Roeck <groeck@...omium.org>,
        linux-kernel@...r.kernel.org, Benson Leung <bleung@...omium.org>,
        miguel.ojeda.sandonis@...il.com, kernel@...labora.com
Subject: Re: [PATCH v3 2/3] power: supply: add cros-ec USBPD charger driver.

Hi,

I found one more issue, otherwise the driver looks fine to me.

On Wed, May 02, 2018 at 11:53:42AM +0200, Enric Balletbo i Serra wrote:
> This driver gets various bits of information about what is connected to
> USB PD ports from the EC and converts that into power_supply properties.
> 
> Signed-off-by: Sameer Nanda <snanda@...omium.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>
> Acked-by: Lee Jones <lee.jones@...aro.org>
> ---
[...]
> +static int cros_usbpd_charger_probe(struct platform_device *pd)
> +{
[...]
> +	for (i = 0; i < charger->num_charger_ports; i++) {
[...]
> +		psy = devm_power_supply_register_no_ws(dev, psy_desc,
> +						       &psy_cfg);
[...]
> +		ec_device->charger = psy;
> + }
[...]
> diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
> index f36125ee9245..a1eb39344231 100644
> --- a/include/linux/mfd/cros_ec.h
> +++ b/include/linux/mfd/cros_ec.h
> @@ -19,6 +19,7 @@
>  #include <linux/cdev.h>
>  #include <linux/device.h>
>  #include <linux/notifier.h>
> +#include <linux/power_supply.h>
>  #include <linux/mfd/cros_ec_commands.h>
>  #include <linux/mutex.h>
>  
> @@ -143,6 +144,7 @@ struct cros_ec_device {
>  			struct cros_ec_command *msg);
>  	int (*pkt_xfer)(struct cros_ec_device *ec,
>  			struct cros_ec_command *msg);
> +	struct power_supply *charger;
>  	struct mutex lock;
>  	bool mkbp_event_supported;
>  	struct blocking_notifier_head event_notifier;

I think cros_ec_device->charger can be dropped:

 * It is not cleared on power-supply removal
 * It randomly points to the last registered power-supply
 * It is only set, but never used

-- Sebastian

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ