tech-kern archive

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

Re: problems with sysmon power



joerg%britannica.bec.de@localhost said:
> If you do a boot -s and plug/unplug the AC you don't get a kernel
> message about that?

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.

> 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'm seeing:
acpibat0 at acpi0 (BAT0, PNP0C0A-1): ACPI Battery (Control Method)
acpibat1 at acpi0 (BAT1, PNP0C0A-2): ACPI Battery (Control Method)
acpibat0: battery info: SMP, LION, DELL YD6236 1939

> Can you be more specific of what you are seeing?

What happened in my case was that the battery check code first
hit acpibat1 (they are inserted at the head of the list).
This one is not present (because the DVD drive sits in that slot).
The code concludes that the battery is not in critical state
and aborts immediately, not looking for the other slot.

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.

[sme_acadapter_check()]
> 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.

best regards
Matthias




-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index