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: <20200503211405.zegrp7e7hiy5whht@earth.universe>
Date:   Sun, 3 May 2020 23:14:05 +0200
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:     Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v2 06/11] power: bq25890: update state on property read

Hi,

On Sun, May 03, 2020 at 05:21:12PM +0200, Michał Mirosław wrote:
> Edge interrupts from the charger may be lost or stuck in fault mode
> since probe(). Check if something changed everytime userspace wants
> some data.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@...labora.com>

-- Sebastian

>  drivers/power/supply/bq25890_charger.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index 3b02fa80aedd..e4368d01396a 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -389,6 +389,8 @@ static bool bq25890_is_adc_property(enum power_supply_property psp)
>  	}
>  }
>  
> +static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq);
> +
>  static int bq25890_power_supply_get_property(struct power_supply *psy,
>  					     enum power_supply_property psp,
>  					     union power_supply_propval *val)
> @@ -399,6 +401,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
>  	int ret;
>  
>  	mutex_lock(&bq->lock);
> +	/* update state in case we lost an interrupt */
> +	__bq25890_handle_irq(bq);
>  	state = bq->state;
>  	do_adc_conv = !state.online && bq25890_is_adc_property(psp);
>  	if (do_adc_conv)
> -- 
> 2.20.1
> 

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