From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH] battery: Fix charge_now returned by broken batteries Date: Sun, 11 Oct 2009 00:49:58 +0200 Message-ID: <20091010224958.GA15826@elf.ucw.cz> References: <4AC91578.2020807@suse.de> <4AC923F4.9050100@suse.de> <4AC93B45.8090707@suse.de> <20091010120448.GB1811@ucw.cz> <20091010212521.GD14051@elf.ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Miguel Ojeda Cc: Alexey Starikovskiy , "Rafael J. Wysocki" , Henrique de Moraes Holschuh , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-acpi@vger.kernel.org On Sat 2009-10-10 23:44:42, Miguel Ojeda wrote: > On Sat, Oct 10, 2009 at 11:25 PM, Pavel Machek wrote: > > Hi! > > > >> >> In "broken" batteries (is it broken finally? or is it expected > >> >> behaviour?) like mine the old problem will be corrected, as it was > >> >> only present in the charged state. > >> > > >> > I believe you better work around this in userspace... or agree that > >> >>100% charge is possible. > >> > >> I agree that >100% charge is possible while charging (because that > >> would mean the battery is over the last charged level); however, what > >> does it mean when charged? > > > > Well, maybe the battery only updates full_charge_capacity during > > powerdown or when the moon is full or something? (IOW you may be > > breaking already working machines). > > > > I do not know about batteries as I said, I was waiting for someone to > point out how batteries (normally/should) work. Different batteries work very differently, I'm afraid. > > Or perhaps add quirk based on DMI or something? > > My battery is easily identified by its model name, so maybe we can > apply the workaround only to known hardware. Still, that is a "heavy" > solution, as I suppose there are many many battery models in the > world. That is why I was asking whether some kind of standard/unified > batteries' values/behavior exists (or implement it) that we can try to > achieve easily with some heuristics like the one I proposed, instead > of some kind of huge table-based workaround system. The heuristics you proposed _will_ break other batteries, so it is not acceptable without checking for model first. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html