Bug 67351 - ACPI Fix that breaks _BIX table parsing.
Summary: ACPI Fix that breaks _BIX table parsing.
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: x86-64 Linux
: P1 high
Assignee: Lan Tianyu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 05:52 UTC by Francisco Castro
Modified: 2014-02-17 01:12 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.8.0.31 onwards
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Binary dump of dmidecode (1.46 KB, application/octet-stream)
2013-12-19 10:55 UTC, Francisco Castro
Details
debug.patch (3.50 KB, patch)
2013-12-20 07:04 UTC, Lan Tianyu
Details | Diff
Fix for nec lz750-ls (3.71 KB, patch)
2013-12-20 18:34 UTC, Francisco Castro
Details | Diff
bat.patch (1.97 KB, patch)
2013-12-23 01:34 UTC, Lan Tianyu
Details | Diff
update_bat.patch (1.83 KB, patch)
2013-12-23 01:36 UTC, Lan Tianyu
Details | Diff

Description Francisco Castro 2013-12-19 05:52:08 UTC
Hello,

Before anything, sorry for my broken english:

The issue to be reported here, is that the "fix" for the bug:

https://bugzilla.kernel.org/show_bug.cgi?id=60519

which was merged from kernel 3.8.0.31 onwards; makes the battery module fail
on a laptop (NEC LZ750/LS) which previously worked. After removing the two
lines that the parch added and recompiling, it works again.

These are the lines that dmesg is now showing:

[    2.272970] ACPI Warning: For \_SB_.PCI0.LPCB.EC__.BAT1._BIX: Return Package is too small - found 19 elements, expected 20 (20121018/nspredef-679)
[    2.272985] battery: probe of PNP0C0A:00 failed with error -14

The "fix" for that issue should be removed, or at least rewritten, since it
breaks compatibility with hardware that's somewhat new, and still on sale.

acpidump is attached to the refferenced bug.
Comment 1 Lan Tianyu 2013-12-19 09:37:42 UTC
Hi, check the _BIX package in the acpidump and it doesn't comply with ACPI5.0 SPEC(Table 10-234). The first member should be "revision" which always should be 0 which the first member of the package on this machine  is "Power Unit" which is the second member according ACPI SPEC. So this is a Bios problem. We can do a quirk for such machine. So please provide the output of the dmidecode.

 Name (BIX0, Package (0x13)
 {           {
                One,
                0x1130,
                0x1130,
                One,
                0x39D0,
                Zero,
                Zero,
                0xFFFFFFFF,
                0x00013880,
                0x07D0,
                0x07D0,
                0x0BB8,
                0x03E8,
                One,
                One,
                "CRB Battery 0",
                "Battery 0",
                "Lipo",
                "-Virtual Battery 0-"
            })
}
Comment 2 Francisco Castro 2013-12-19 10:55:39 UTC
Created attachment 119011 [details]
Binary dump of dmidecode
Comment 3 Lan Tianyu 2013-12-20 07:04:38 UTC
Created attachment 119131 [details]
debug.patch

Please try this patch.
Comment 4 Francisco Castro 2013-12-20 18:34:01 UTC
Created attachment 119151 [details]
Fix for nec lz750-ls

I modified the previous patch, changing the order where dmi_check_system is called. That's because acpi_bus_register_driver ends up calling acpi_battery_add, which calls acpi_battery_update which calls acpi_battery_get_info (where the battery_bix_broken_package flag is used).

And now it's working again.
Comment 5 Lan Tianyu 2013-12-23 01:34:43 UTC
Created attachment 119311 [details]
bat.patch

Thanks for test and correction. I just rework the patch. Please test again.
Comment 6 Lan Tianyu 2013-12-23 01:36:58 UTC
Created attachment 119321 [details]
update_bat.patch
Comment 7 Francisco Castro 2013-12-23 06:42:24 UTC
Tested and working.

Thank you!
Comment 8 Lan Tianyu 2014-01-02 07:49:00 UTC
Fix patch is sent to ACPI maillist.
https://patchwork.kernel.org/patch/3423901/

Note You need to log in before you can comment on or make changes to this bug.