Commit d9b72fae authored by Len Brown's avatar Len Brown

[ACPI] CONFIG_ACPI_RELAXED_AML from 2.4

http://bugzilla.kernel.org/show_bug.cgi?id=1248
parent 461c312b
......@@ -281,5 +281,17 @@ config ACPI_EFI
depends on IA64
default y
config ACPI_RELAXED_AML
bool
depends on ACPI_INTERPRETER
depends on !IA64_SGI_SN
default n
help
If you say `Y' here, the ACPI interpreter will relax its checking
for valid AML and will ignore some AML mistakes, such as off-by-one
errors in region sizes. Some laptops may require this option. In
particular, many Toshiba laptops require this for correct operation
of the AC module.
endmenu
......@@ -139,7 +139,41 @@ acpi_ex_setup_region (
field_datum_byte_offset, obj_desc->common_field.access_byte_width,
rgn_desc->region.node->name.ascii, rgn_desc->region.length));
return_ACPI_STATUS (AE_AML_REGION_LIMIT);
#ifdef CONFIG_ACPI_RELAXED_AML
{
/*
* Allow access to the field if it is within the region size
* rounded up to a multiple of the access byte width. This
* overcomes "off-by-one" programming errors in the AML often
* found in Toshiba laptops. These errors were allowed by
* the Microsoft ASL compiler.
*/
u32 rounded_length = ACPI_ROUND_UP(rgn_desc->region.length,
obj_desc->common_field.access_byte_width);
if (rounded_length < (obj_desc->common_field.base_byte_offset
+ field_datum_byte_offset
+ obj_desc->common_field.access_byte_width)) {
return_ACPI_STATUS (AE_AML_REGION_LIMIT);
} else {
static int warn_once = 1;
if (warn_once) {
// Could also associate a flag with each field, and
// warn once for each field.
ACPI_REPORT_WARNING((
"The ACPI AML in your computer contains errors, "
"please nag the manufacturer to correct it.\n"));
ACPI_REPORT_WARNING((
"Allowing relaxed access to fields; "
"turn on CONFIG_ACPI_DEBUG for details.\n"));
warn_once = 0;
}
return_ACPI_STATUS (AE_OK);
}
}
#else
return_ACPI_STATUS (AE_AML_REGION_LIMIT);
#endif
}
return_ACPI_STATUS (AE_OK);
......
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