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: <20120927033604.GH8836@lizard>
Date:	Wed, 26 Sep 2012 20:36:04 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	mathieu.poirier@...aro.org
Cc:	linux-kernel@...r.kernel.org, dwmw2@...radead.org
Subject: Re: [PATCH 17/57] power: ab8500_bm: Added support for BATT_OVV

On Tue, Sep 25, 2012 at 10:12:14AM -0600, mathieu.poirier@...aro.org wrote:
> From: Hakan Berg <hakan.berg@...ricsson.com>
> 
> Add support for the battery over-voltage situation
> 
> Signed-off-by: Hakan Berg <hakan.berg@...ricsson.com>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@...ricsson.com>
> ---
>  drivers/power/ab8500_fg.c |   32 ++++++++++++++++----------------
>  1 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
> index c4d9307..8507254 100644
> --- a/drivers/power/ab8500_fg.c
> +++ b/drivers/power/ab8500_fg.c
> @@ -1842,24 +1842,26 @@ static void ab8500_fg_check_hw_failure_work(struct work_struct *work)
>  	 * If we have had a battery over-voltage situation,
>  	 * check ovv-bit to see if it should be reset.
>  	 */
> -	if (di->flags.bat_ovv) {
> -		ret = abx500_get_register_interruptible(di->dev,
> -			AB8500_CHARGER, AB8500_CH_STAT_REG,
> -			&reg_value);
> -		if (ret < 0) {
> -			dev_err(di->dev, "%s ab8500 read failed\n", __func__);
> -			return;
> -		}
> -		if ((reg_value & BATT_OVV) != BATT_OVV) {
> -			dev_dbg(di->dev, "Battery recovered from OVV\n");
> -			di->flags.bat_ovv = false;
> +	ret = abx500_get_register_interruptible(di->dev,
> +		AB8500_CHARGER, AB8500_CH_STAT_REG,
> +		&reg_value);
> +	if (ret < 0) {
> +		dev_err(di->dev, "%s ab8500 read failed\n", __func__);
> +		return;
> +	}
> +	if ((reg_value & BATT_OVV) == BATT_OVV) {
> +		if (!di->flags.bat_ovv) {
> +			dev_dbg(di->dev, "Battery OVV\n");
> +			di->flags.bat_ovv = true;
>  			power_supply_changed(&di->fg_psy);
> -			return;
>  		}
> -
>  		/* Not yet recovered from ovv, reschedule this test */
>  		queue_delayed_work(di->fg_wq, &di->fg_check_hw_failure_work,
> -				   round_jiffies(HZ));
> +			HZ);

Why this change? I.e. round_jiffies(HZ) -> HZ?

Yes, it seems like round_jiffies(HZ) is not needed since HZ itself is a
full second.. But the change itself does not belong to this patch.

> +		} else {
> +			dev_dbg(di->dev, "Battery recovered from OVV\n");
> +			di->flags.bat_ovv = false;
> +			power_supply_changed(&di->fg_psy);
>  	}
>  }
>  
> @@ -2039,8 +2041,6 @@ static irqreturn_t ab8500_fg_batt_ovv_handler(int irq, void *_di)
>  	struct ab8500_fg *di = _di;
>  
>  	dev_dbg(di->dev, "Battery OVV\n");
> -	di->flags.bat_ovv = true;
> -	power_supply_changed(&di->fg_psy);
>  
>  	/* Schedule a new HW failure check */
>  	queue_delayed_work(di->fg_wq, &di->fg_check_hw_failure_work, 0);
> -- 
> 1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ