Commit 20edd74f authored by Zhao Yakui's avatar Zhao Yakui Committed by Len Brown

ACPI: Ignore AE_NOT_FOUND error of EC _REG method and continue to initialize EC

On some broken BIOS the ACPI object in EC _REG method can't be found in
ACPI namespace, which causes that the status code of AE_NOT_FOUND is returned by
the EC _REG object. In such case the EC device can't be initialized correctly,
which causes that battery/AC adapter can't work normally. As the EC address
space handler is not removed and the memory pointed by its input argument is
already free, sometimes the kernel will also be panic when EC internal register
is still accessed. But the windows can work well on such broken BIOS.

Maybe it will be reasonable that OS ignores the AE_NOT_FOUND error
returned by the EC _REG object and continues to initialize EC device
on some broken BIOS.
For example: the ACPI object in EC _REG method can't be found and status error
code is AE_NOT_FOUND.

http://bugzilla.kernel.org/show_bug.cgi?id=8953
http://bugzilla.kernel.org/show_bug.cgi?id=10237

lenb: we may find a more general solution to this in the future.
Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3fa8749e
......@@ -862,9 +862,20 @@ static int ec_install_handlers(struct acpi_ec *ec)
&acpi_ec_space_handler,
NULL, ec);
if (ACPI_FAILURE(status)) {
acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
if (status == AE_NOT_FOUND) {
/*
* Maybe OS fails in evaluating the _REG object.
* The AE_NOT_FOUND error will be ignored and OS
* continue to initialize EC.
*/
printk(KERN_ERR "Fail in evaluating the _REG object"
" of EC device. Broken bios is suspected.\n");
} else {
acpi_remove_gpe_handler(NULL, ec->gpe,
&acpi_ec_gpe_handler);
return -ENODEV;
}
}
ec->handlers_installed = 1;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment