Bug 10240
Summary: | Failed to read /proc/acpi/battery/BAT0/info | ||
---|---|---|---|
Product: | ACPI | Reporter: | Stepan Zastupov (redchrom) |
Component: | Power-Battery | Assignee: | ykzhao (yakui.zhao) |
Status: | CLOSED WILL_NOT_FIX | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.24.3 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: |
dsdt.dsl
Output of acpidump cpu0cst cpu0ist dmesg |
Description
Stepan Zastupov
2008-03-14 02:38:41 UTC
Will you please attach the output of acpidump? Thanks. Created attachment 15304 [details]
dsdt.dsl
DSDT attached. Yesterday I have found the roots of problem, here is the part of extract_package from battery.c:
if (offsets[i].mode) {
u8 *ptr = (u8 *)battery + offsets[i].offset;
if (element->type == ACPI_TYPE_STRING ||
element->type == ACPI_TYPE_BUFFER)
strncpy(ptr, element->string.pointer, 32);
else if (element->type == ACPI_TYPE_INTEGER) {
strncpy(ptr, (u8 *)&element->integer.value,
sizeof(acpi_integer));
ptr[sizeof(acpi_integer)] = 0;
} else
return -EFAULT; // Problem is here!!!
}
BIOS returns ACPI_TYPE_ANY type. I've temporary commented return statement and successfully read battery information (without some fields). I know that the bug is in my bios, but don't know how to fix the dsdt (i've spent two hours playing with BIF method). Maybe will be better just to skip some types?
Thank you.
Thanks for the works. What you said in comment #3 is right. The problem is related with BIOS. There exists the following in the DSDT.dsl >Name (BIFP, Package (0x0D) { One, Ones, Ones, One, Ones, 0x012C, 0x96, One, One, Z003, Z004, "LIon", Z005 > }) Z003, Z004 is declared in the other SSDT.dsl. And acpica can't parse the above package. Will you please try the patch in bug 9429?Maybe it can fix the problem in your laptop. Thanks. If you talk about http://bugzilla.kernel.org/attachment.cgi?id=13831&action=view , this patch is already in my 2.6.24.3 kernel. Thanks for the confirm. Will you please attach the output of acpidump? The pmtool-20071116 can be found in http://www.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/ Thanks. Created attachment 15305 [details]
Output of acpidump
Acpidump dump attached.
The dmesg shown that you are useing an customized DSDT. Stepan, can you please attach the dmesg with the original DSDT? :) What Rui in comment #7 is right. Please use the original DSDT and see whether the info of battery is correct. At the same time it seems that there is no definition for Z003,Z004 in the DSDT or SSDT. Will you please attach the following output? acpidump --addr 0x37e8f423 --length 0x2BE -o cpu0ist acpidump --addr 0x37e8eeda --length 0x4c4 -o cpu0cst Thanks. Created attachment 15306 [details]
cpu0cst
acpidump --addr 0x37e8eeda --length 0x4c4 -o cpu0cst
Created attachment 15307 [details]
cpu0ist
acpidump --addr 0x37e8f423 --length 0x2BE -o cpu0ist
Created attachment 15308 [details]
dmesg
dmesg with vendor DSDT
Hi, Stepan
Thanks for the info.
It seems that this is caused by broken BIOS.
>Name (BIFP, Package (0x0D) {
One,
Ones,
Ones,
One,
Ones,
0x012C,
0x96,
One,
One,
Z003,
Z004,
"LIon",
Z005
> })
And the Z003,Z004,Z005 can't be found in other SSDT.dsl. The Linux acpi can't parse the above package.
It will be appropriate to fix this bug by upgrading BIOS.
was: Z003, Z004, "LIon", Z005 become: "Foo3", "Foo4", "LIon", "Foo5" Works fine :) : cat /proc/acpi/battery/BAT0/info present: yes design capacity: 4800 mAh last full capacity: 5010 mAh battery technology: rechargeable design voltage: 11100 mV design capacity warning: 501 mAh design capacity low: 250 mAh capacity granularity 1: 1 mAh capacity granularity 2: 1 mAh model number: Foo3 serial number: Foo4 battery type: LIon OEM info: Foo5 |