Date: Sun, 7 Dec 2014 08:03:20 -0800 From: Adrian Chadd <adrian@freebsd.org> To: Colin Percival <cperciva@freebsd.org> Cc: "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org> Subject: Re: ENXIOing non-present battery Message-ID: <CAJ-Vmokzdep71ty_ctvAEQSDvCsOQj15wQ8p96%2B3fCBtr8dvYg@mail.gmail.com> In-Reply-To: <54840781.70603@freebsd.org> References: <54840781.70603@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Wait - so it reports a battery with 0% in it, but not that it's not present? How's this work on other systems? KDE on Linux doesn't lose its mind if the second battery is totally flat. -adrian On 6 December 2014 at 23:53, Colin Percival <cperciva@freebsd.org> wrote: > Hi ACPI people, > > On my Dell Latitude E7440 laptop, the ACPI reports two batteries: First > the battery which exists; and second, a "Not Present" battery with zeroed > statistics. FreeBSD, not realizing that this second battery is a complete > myth -- the E7440 only has one battery, and there is nowhere to add another > -- faithfully reports the data from ACPI to userland. > > Unfortunately it causes some problems there; in particular, KDE interprets > it as meaning that the system should have two batteries, and when it sees > that the "second" battery has 0% power remaining it kicks off the "battery > is low, turn the laptop off" code. If that code is disabled, it still > displays the wrong battery-charge-remaining status icons. > > For dealing with such broken ACPIs, it seems like not attaching a non-present > battery would be a good idea. This shouldn't be the default behaviour, since > there are plenty of systems where a non-present battery might be inserted at > a later time; but I see nothing wrong with adding an option. > > The attached patch adds a acpi.cmbat.hide_not_present loader tunable which, > as the name suggests, hides non-present batteries; this is done in the probe > code by returning ENXIO if the tunable is set to a nonzero value and > acpi_BatteryIsPresent returns zero. With this patch and the tunable set my > laptop behaves appropriately; and (aside from wasting a few bytes of memory) > there should be no effect on systems where the tunable is not set. > > Any objections to me committing this? > > -- > Colin Percival > Security Officer Emeritus, FreeBSD | The power to serve > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid > > _______________________________________________ > freebsd-acpi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-acpi > To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmokzdep71ty_ctvAEQSDvCsOQj15wQ8p96%2B3fCBtr8dvYg>