tech-kern archive

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

Re: problems with sysmon power

On Mon, Mar 10, 2008 at 08:11:26PM +0100, Matthias Drochner wrote:
> I get that message. What I said was
>       is not updated until either the state changes
>       (if I unplug/replug the power supply), or "envstat" is invoked
> So if I just boot with AC and neither unplug the connector not invoke
> "envstat", the kernel keeps believing that no AC is present.

Ah, so it doesn't handle the initial state correctly? That should be
easy to fix.

> > The logic is working for a two battery Thinkpad, so it can't be that
> > flawed.
> It might depend on the order the batteries are asked. Or on some
> details in behaviour (in ACPI: control method vs smart).

I am not aware of systems exporting smart batteries. I don't think we
support those really.

> What I called the flaw in the logics is the fact that the booleans
> keeping track whether a charge sensor exists for a battery are
> checked outside the loop. They are per-battery, so they should
> be checked inside. Otherwise, one mixes findings from different
> batteries.

No, you understand the logic wrong. The problem here is that some
batteries don't export the charge state or the remaining capacity.
If any of the battery is not discharging or not critical, the system is
overall not in a critical state. That's also why I said the acpi_bat
should not export empty slots.

> > I think the logic is currently inverted (drop
> > out if one AC is connected with true vs. drop out of one AC is
> > disconnected).
> It is worse: the code does always only ask the first adapter
> in the list.

Yeah, to be fair -- this code was written for notebooks and those don't
have multiple ACs :-)


Home | Main Index | Thread Index | Old Index