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: <20100518182422.GJ30801@buzzloop.caiaq.de>
Date:	Tue, 18 May 2010 20:24:23 +0200
From:	Daniel Mack <daniel@...aq.de>
To:	Anton Vorontsov <cbouatmailru@...il.com>
Cc:	linux-kernel@...r.kernel.org, Matt Reimer <mreimer@...p.net>,
	Evgeniy Polyakov <zbr@...emap.net>, Tejun Heo <tj@...nel.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Andres Salomon <dilinger@...labora.co.uk>,
	Alexey Starikovskiy <astarikovskiy@...e.de>,
	Len Brown <len.brown@...el.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH 2/3] power/ds2760_battery: make charge_now and
 charge_full writeable

(sorry for the late follow-up)

On Tue, May 11, 2010 at 10:05:51PM +0400, Anton Vorontsov wrote:
> On Tue, May 11, 2010 at 07:28:59PM +0200, Daniel Mack wrote:
> [...]
> > > 1. Could you at least change this back to
> > >    POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, so it'll be clear what
> > >    exactly this prop is actually changing, and
> > 
> > Do you see any other way to store the actual rated capacity (not the one
> > the battery had in its good days) inside the chip?
> 
> In that case it should be indeed POWER_SUPPLY_PROP_CHARGE_FULL,
> which is full_active_uAh, which we get from di->raw[DS2760_ACTIVE_FULL]
> and di->raw[DS2760_ACTIVE_FULL + 1].
> 
> We fall back to deriving it from rated_capacity if full_active
> is 0 (your case?):
> 
>         /* If the full_active_uAh value is not given, fall back to the rated
>          * capacity. This is likely to happen when chips are not part of the
>          * battery pack and is therefore not bootstrapped. */
>         if (di->full_active_uAh == 0)
>                 di->full_active_uAh = di->rated_capacity / 1000L;
> 
> So, you probably want to make DS2760_ACTIVE_FULL writable, not
> DS2760_RATED_CAPACITY.

Ah of course. And DS2760_ACTIVE_FULL is 16bit wide, so we also get rid
of the range problem.

Thanks,
Daniel
--
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