[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#656668: 3.2 has different /sys/class/power

On Fri, Jan 20, 2012 at 02:16:32PM -0600, Adam Heath wrote:
> severity 656668 minor
> thanks
> (haven't actually gotten your mail yet, it's stuck due to
> greylisting; I'm writing this based on what I see in website).
> Actually, this is not the correct bug.
> My laptop lost complete power.  The battery was fully drained.  I
> plugged in it, booted it up, and there was *no* BAT0 in that folder.
> After some amount of charging, I rebooted back into 3.1, and there
> was the BAT0, but no ADP1.
> Rebooted back into 3.2, and there was both ADP1 and BAT0.
> So, the bug here is that when the battery has 0% charge, linux isn't
> adding it to the list.  Sounds like a null vs. 0 type simple logic
> error.

This is very likely a firmware bug, not a kernel bug.

> Additionally, linux only appears to enumerate batteries at system
> boot.  What would happen if a battery was added/removed later on?

The ACPI battery driver will probe all battery *slots* reported by
the firmware, and will create a power_supply device whenever the
firmware reports that a battery is present.  However, if the initial
requests to read the battery status (presence, capacity, etc.) fail
then the driver fails to bind.

Presumably the firmware on this system is reporting failure to read
the battery status when the battery is nearl empty.  Perhaps the
driver should work around that.  But please stop speculating that the
kernel is doing something stupid, when you could quite easily test
that scenario and find that it does the right thing.


Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
                                                              - Albert Camus

Reply to: