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, 30 Mar 2016 17:09:20 +0200
From:	Sebastian Reichel <sre@...nel.org>
To:	YH Huang <yh.huang@...iatek.com>
Cc:	Rhyland Klein <rklein@...dia.com>,
	Daniel Kurtz <djkurtz@...omium.org>, linux-pm@...r.kernel.org,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@...ts.infradead.org>,
	Matthias Brugger <matthias.bgg@...il.com>,
	David Woodhouse <dwmw2@...radead.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] sbs-battery: fix power status when battery is dry

Hi,

On Wed, Mar 30, 2016 at 04:58:30PM +0800, YH Huang wrote:
> If I revise the description in this way(using your clear explanation):
> ------------------------------------------------------------------------
> The battery capacity changing course is like this:
> 
> full: BATTERY_FULLY_CHARGED => POWER_SUPPLY_STATUS_FULL
> <unplug AC>
> high->low: BATTERY_DISCHARGING => POWER_SUPPLY_STATUS_DISCHARGING
> ~0%: DISCHARGING & FULLY_DISCHARGED => POWER_SUPPLY_STATUS_NOT_CHARGING
> <plug in AC>
> 0%~20%: FULLY_DISCHARGED => POWER_SUPPLY_STATUS_CHARGING
> 20%~: No flag => POWER_SUPPLY_STATUS_CHARGING
> 
> For now, it is not exactly right to show the status as
> POWER_SUPPLY_STATUS_NOT_CHARGING when the battery is dry
> (FULLY_DISCHARGED) and AC is plugged in.
> Although the battery is in a low level, system works fine with the AC
> charging.
> It is better to say that the battery is charging.
> ------------------------------------------------------------------------
> 
> How about this?
> By the way, should I also revise the title?

POWER_SUPPLY_STATUS_NOT_CHARGING is used for AC connected, but
battery not charging (e.g. because battery temperature is out
of acceptable range). If you are discharging use
POWER_SUPPLY_STATUS_DISCHARGING.

You should just ignore the FULLY_DISCHARGED bit in the status
property. If you don't want to loose the information about fully
discharged battery add POWER_SUPPLY_PROP_CAPACITY_LEVEL, which maps:

BATTERY_FULLY_CHARGED => POWER_SUPPLY_CAPACITY_LEVEL_FULL
FULLY_DISCHARGED => POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL
otherwise => POWER_SUPPLY_CAPACITY_LEVEL_NORMAL

-- Sebastian

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ