#8922 NORM Not Tri: EC battery queries should indicate "missing" status
Zarro Boogs per Child
bugtracker at laptop.org
Sun Nov 2 11:07:45 EST 2008
#8922: EC battery queries should indicate "missing" status
----------------------------+-----------------------------------------------
Reporter: pgf | Owner: pgf
Type: enhancement | Status: new
Priority: normal | Milestone: Not Triaged
Component: not assigned | Version: Development build as of this date
Resolution: | Keywords:
Next_action: code | Verified: 0
Blockedby: | Blocking:
----------------------------+-----------------------------------------------
Comment(by pgf):
quoting from the devel mailing list
{{{
Date: Sat, 01 Nov 2008 18:26:16 EDT
To: Paul Fox
cc: richard, dilinger, devel
From: Andres Salomon
Subject: Re: ec battery commands
On Sat, 01 Nov 2008 16:39:49 -0400
Paul Fox wrote:
> hi dilinger -- one of the tasks on the EC punchlist is this one:
>
> "Make battery commands return 0xff (or some other invalid value)
> if the battery is not present. This will be an error indication
> for the kernel."
>
> can you point me at the kernel code that cares about this, and, in
> particular if you can remember, for which commands it's most important
> to have this behavior changed? i'd like to be sure i understand
> the req'ts before implementing anything.
>
Certainly; the specific code is drivers/power/olpc_battery.c. The code
that
is acutally querying the battery status is olpc_bat_get_property(). Due
to the current limitations of the API, we cannot simply fetch EC_BAT_ACR;
every value is valid, and (aiui) the EC will simply return the last known
value. This is undesirable if there's no battery present, so we currently
first check EC_BAT_STATUS (for PRESENT), and then run the necessary EC
command. This means that each query ends up running 2 EC commands. It
would be nice to cut that down to 1.
Along those lines, it would be nice if there was an error value that we
could check for if the EC thinks that there is no battery present, and
we run some random command that is querying for battery info. Richard
and I discussed this a bunch a long time ago, but it was in person and
my memory is fuzzy.. I don't remember if we came up w/ a value that
would work across all EC battery commands. It would kind of suck if
we had to have different error codes for different commands, but that
would still be better than our current behavior.
_______________________________________________
Devel mailing list
Devel at lists.laptop.org
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/8922#comment:1>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list