At boot: When I boot up without the battery in my laptop the kernel reports that the battery is still there and that it is empty (charged at 0%). Coming back from suspend to ram or suspend to disk will cause the detection that the battery is not present. Also: When it is AC adaptor-no battery state is correctly detected, if i go to suspend, insert the battery, disconnect the adaptor, and come back from suspend, kernel doesn't detect the new battery-only state. Pluging and unplugging the AC adaptor fixes it. This problem has been happening for as long as i can remember (2.6.27...?). The main implication concerns that the power-saving mechanisms are not turned on when the battery presence is misdetected. Let me know if i can be any help attaching other infos...
Could you please check more recent kernel, say 2.6.34-rcX?
sorry, spelling mistake on kernel version. im actually on 2.6.34-rc5 and not 2.6.24
Please provide acpidump and dmesg outputs. Please append the output of "grep . /proc/battery/*/*"
Created attachment 26175 [details] acpidump output
Created attachment 26176 [details] dmesg output right after booting without the battery
Created attachment 26177 [details] contents of /proc/acpi/battery Note that this correspond to a moment when the battery is present and therefore correctly detected. if i try to run "grep . /proc/acpi/battery/*/*" when the battery is misdetected (battery is not present but acpi has initially considered it is -like shown in the dmesg output ive attached), that automaticly causes the lack of battery to be detected, giving the following correct output: /proc/acpi/battery/BAT0/alarm:present: no /proc/acpi/battery/BAT0/info:present: no /proc/acpi/battery/BAT0/state:present: no My battery monitor changes its icon to "AC adaptor only" right at that moment.
BATS is set unconditionally in _REG method, even if the battery is not present at the moment. This is wrong, IMO, AML code should reset the BATS value based on PCI0.LPC.EC0.ESTS, once the EC operegion can be accessed, we can re-write the BAT0._STA method like: Name (BATT, Zero) Method (_STA, 0, NotSerialized) { If (LEqual(BATT, Zero)) { Store (\_SB.PCI0.LPC.EC0.ESTS, Local0) If (LEqual (And (Local0, 0x08), 0x08)) { Store (One, BATS) } Else { Store (Zero, BATS) } Store (One, BATT) } If (ECON) { If (BATS) { Return (0x1F) } Else { Return (0x0F) } } Else { Return (0x0F) } Return (0x0F) }
Created attachment 26332 [details] custom DSDT please try this custom DSDT and see if the problem still exists. To override a DSDT, you can follow step 5, 6, and 7 at http://www.lesswatts.org/projects/acpi/overridingDSDT.php
Please, could you provide a DSTD built with "iasl -ta" so I can try it with the initrd method? or just the DSTD.dsl. Thanks
Created attachment 26333 [details] custom DSDT source code dsdt.dsl attached. :)
(In reply to comment #9) > Please, could you provide a DSTD built with "iasl -ta" so I can try it with > the > initrd method? or just the DSTD.dsl. Thanks BTW, I'm wondering how you can use the initrd method as it's not supported in Linux kernel any more... :)
(In reply to comment #11) > (In reply to comment #9) > > Please, could you provide a DSTD built with "iasl -ta" so I can try it with > the > > initrd method? or just the DSTD.dsl. Thanks > > BTW, I'm wondering how you can use the initrd method as it's not supported in > Linux kernel any more... :) Is it not? It looked like a too easy, time-saving way... Did it work back in 2.6.27? I can try on that one... In any case, iasl complains: Intel ACPI Component Architecture ASL Optimizing Compiler version 20100428 [May 11 2010] Copyright (c) 2000 - 2010 Intel Corporation Supports ACPI Specification Revision 4.0a DSDT.dsl 1234: And (CAPB, 0xFFFFFFFC) Warning 1106 - ^ Result is not used, operator has no effect DSDT.dsl 1419: 0x00000000, // Length Error 4122 - ^ Invalid combination of Length and Min/Max fixed flags ASL Input: DSDT.dsl - 5119 lines, 176479 bytes, 2194 keywords Compilation complete. 1 Errors, 1 Warnings, 0 Remarks, 33 Optimizations
please try "iasl -ta -cr DSDT.dsl"
ping ...
eh, i have been away last week, but will take care of this in the next few days. I haven't forgotten dont worry (the battery monitor reminds me everyday :) )
Hi, your custom DSDT seems to fix the problem. :) can the patch be included in the mainline? thank you!
No, :( If the custom DSDt works for you, this means that this is an AML code logic error, rather than a Linux/kernel/ACPI problem. So I'm afraid there is nothing we can do in Linux kernel. As this bug should also affect Windows, would you please check if there is any new BIOS released for your laptop? as this is the only way to fix the problem. :(
Ok thanks for everything anyway. Just in case someone's googling for this: vendor: MALATA model: PC-81005 Though it has been sold under different brands like BluSens... and its not the first BIOS-related problem showing up (https://bugs.freedesktop.org/show_bug.cgi?id=25523) hoping its the last :)