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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 28 Oct 2007 10:50:45 +0400
From:	Andrey Borzenkov <arvidjaar@...l.ru>
To:	cbou@...l.ru
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	dwmw2@...radead.org, Alexey Starikovskiy <aystarik@...il.com>
Subject: Re: [PATCH] 2.6.24-rc1: ensure "present" sysfs attribute even if battery is absent

On Saturday 27 October 2007, Anton Vorontsov wrote:
> On Sat, Oct 27, 2007 at 08:54:30PM +0400, Andrey Borzenkov wrote:
> > I am not exactly sure about this one ... what other power_supply class
> > drivers do? Should I fix HAL instead (but then, I do not know whether HAL
> > is the only application that is using this interface).
>
> Well, PROP_PRESENT wasn't my idea, currently it's used by pmu and
> olpc drivers becuase it's not trivial to register/unregister their
> batteries on physical insertion/removal. I have some plans to teach
> at least pmu batteries to not use PROP_PRESENT. I don't have any
> OLPC, thus I can't convert it.
>
> To sum this: the good way to handle "missing" batteries is to
> unregister them, so they'll not show up in the /sys/class/power_supply.

Well, in this case HAL behaviour makes sense (default to present == true 
if "present" attribute is missing)

> Is that possible with the ACPI?
>

At least looking in ACPI specs, this looks possible. What currently is 
presented as battery object is actually battery bay according to ACPI spec:

Unlike most other devices, when a battery is inserted or removed from the 
system, the device itself (the
battery bay) is still considered to be present in the system.

When battery is inserted/removed, ACPI notifies us and we can check whether 
battery is actually present and update registration accordingly. From the 
sysfs structure POV probably nothing has to be changed; just when and how 
power_supply is registered 
under /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:0n

Alexey, does it make sense (or doable)?


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ