diff options
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/acglobal.h | 6 | ||||
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 1 | ||||
-rw-r--r-- | drivers/acpi/acpica/acpredef.h | 1 | ||||
-rw-r--r-- | drivers/acpi/acpica/nspredef.c | 19 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsrepair2.c | 15 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 27 |
6 files changed, 58 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 73863d86f022..76dc02f15574 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -126,6 +126,12 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE); | |||
126 | */ | 126 | */ |
127 | u8 ACPI_INIT_GLOBAL(acpi_gbl_truncate_io_addresses, FALSE); | 127 | u8 ACPI_INIT_GLOBAL(acpi_gbl_truncate_io_addresses, FALSE); |
128 | 128 | ||
129 | /* | ||
130 | * Disable runtime checking and repair of values returned by control methods. | ||
131 | * Use only if the repair is causing a problem on a particular machine. | ||
132 | */ | ||
133 | u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_auto_repair, FALSE); | ||
134 | |||
129 | /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ | 135 | /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ |
130 | 136 | ||
131 | struct acpi_table_fadt acpi_gbl_FADT; | 137 | struct acpi_table_fadt acpi_gbl_FADT; |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index c7f743ca395b..5552125d8340 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -357,6 +357,7 @@ struct acpi_predefined_data { | |||
357 | char *pathname; | 357 | char *pathname; |
358 | const union acpi_predefined_info *predefined; | 358 | const union acpi_predefined_info *predefined; |
359 | union acpi_operand_object *parent_package; | 359 | union acpi_operand_object *parent_package; |
360 | struct acpi_namespace_node *node; | ||
360 | u32 flags; | 361 | u32 flags; |
361 | u8 node_flags; | 362 | u8 node_flags; |
362 | }; | 363 | }; |
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index 94e73c97cf85..c445cca490ea 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h | |||
@@ -468,6 +468,7 @@ static const union acpi_predefined_info predefined_names[] = | |||
468 | {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, | 468 | {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, |
469 | {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, | 469 | {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, |
470 | {{"_TC2", 0, ACPI_RTYPE_INTEGER}}, | 470 | {{"_TC2", 0, ACPI_RTYPE_INTEGER}}, |
471 | {{"_TDL", 0, ACPI_RTYPE_INTEGER}}, | ||
471 | {{"_TIP", 1, ACPI_RTYPE_INTEGER}}, | 472 | {{"_TIP", 1, ACPI_RTYPE_INTEGER}}, |
472 | {{"_TIV", 1, ACPI_RTYPE_INTEGER}}, | 473 | {{"_TIV", 1, ACPI_RTYPE_INTEGER}}, |
473 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, | 474 | {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, |
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index 9fb03fa8ffde..c845c8089f39 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c | |||
@@ -193,14 +193,20 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, | |||
193 | } | 193 | } |
194 | 194 | ||
195 | /* | 195 | /* |
196 | * 1) We have a return value, but if one wasn't expected, just exit, this is | 196 | * Return value validation and possible repair. |
197 | * not a problem. For example, if the "Implicit Return" feature is | ||
198 | * enabled, methods will always return a value. | ||
199 | * | 197 | * |
200 | * 2) If the return value can be of any type, then we cannot perform any | 198 | * 1) Don't perform return value validation/repair if this feature |
201 | * validation, exit. | 199 | * has been disabled via a global option. |
200 | * | ||
201 | * 2) We have a return value, but if one wasn't expected, just exit, | ||
202 | * this is not a problem. For example, if the "Implicit Return" | ||
203 | * feature is enabled, methods will always return a value. | ||
204 | * | ||
205 | * 3) If the return value can be of any type, then we cannot perform | ||
206 | * any validation, just exit. | ||
202 | */ | 207 | */ |
203 | if ((!predefined->info.expected_btypes) || | 208 | if (acpi_gbl_disable_auto_repair || |
209 | (!predefined->info.expected_btypes) || | ||
204 | (predefined->info.expected_btypes == ACPI_RTYPE_ALL)) { | 210 | (predefined->info.expected_btypes == ACPI_RTYPE_ALL)) { |
205 | goto cleanup; | 211 | goto cleanup; |
206 | } | 212 | } |
@@ -212,6 +218,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, | |||
212 | goto cleanup; | 218 | goto cleanup; |
213 | } | 219 | } |
214 | data->predefined = predefined; | 220 | data->predefined = predefined; |
221 | data->node = node; | ||
215 | data->node_flags = node->flags; | 222 | data->node_flags = node->flags; |
216 | data->pathname = pathname; | 223 | data->pathname = pathname; |
217 | 224 | ||
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index 973883babee1..024c4f263f87 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c | |||
@@ -503,6 +503,21 @@ acpi_ns_repair_TSS(struct acpi_predefined_data *data, | |||
503 | { | 503 | { |
504 | union acpi_operand_object *return_object = *return_object_ptr; | 504 | union acpi_operand_object *return_object = *return_object_ptr; |
505 | acpi_status status; | 505 | acpi_status status; |
506 | struct acpi_namespace_node *node; | ||
507 | |||
508 | /* | ||
509 | * We can only sort the _TSS return package if there is no _PSS in the | ||
510 | * same scope. This is because if _PSS is present, the ACPI specification | ||
511 | * dictates that the _TSS Power Dissipation field is to be ignored, and | ||
512 | * therefore some BIOSs leave garbage values in the _TSS Power field(s). | ||
513 | * In this case, it is best to just return the _TSS package as-is. | ||
514 | * (May, 2011) | ||
515 | */ | ||
516 | status = | ||
517 | acpi_ns_get_node(data->node, "^_PSS", ACPI_NS_NO_UPSEARCH, &node); | ||
518 | if (ACPI_SUCCESS(status)) { | ||
519 | return (AE_OK); | ||
520 | } | ||
506 | 521 | ||
507 | status = acpi_ns_check_sorted_list(data, return_object, 5, 1, | 522 | status = acpi_ns_check_sorted_list(data, return_object, 5, 1, |
508 | ACPI_SORT_DESCENDING, | 523 | ACPI_SORT_DESCENDING, |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 48db0944ce4a..62365f6075dd 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -126,12 +126,29 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | /* | 128 | /* |
129 | * Originally, we checked the table signature for "SSDT" or "PSDT" here. | 129 | * Validate the incoming table signature. |
130 | * Next, we added support for OEMx tables, signature "OEM". | 130 | * |
131 | * Valid tables were encountered with a null signature, so we've just | 131 | * 1) Originally, we checked the table signature for "SSDT" or "PSDT". |
132 | * given up on validating the signature, since it seems to be a waste | 132 | * 2) We added support for OEMx tables, signature "OEM". |
133 | * of code. The original code was removed (05/2008). | 133 | * 3) Valid tables were encountered with a null signature, so we just |
134 | * gave up on validating the signature, (05/2008). | ||
135 | * 4) We encountered non-AML tables such as the MADT, which caused | ||
136 | * interpreter errors and kernel faults. So now, we once again allow | ||
137 | * only "SSDT", "OEMx", and now, also a null signature. (05/2011). | ||
134 | */ | 138 | */ |
139 | if ((table_desc->pointer->signature[0] != 0x00) && | ||
140 | (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) | ||
141 | && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { | ||
142 | ACPI_ERROR((AE_INFO, | ||
143 | "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", | ||
144 | acpi_ut_valid_acpi_name(*(u32 *)table_desc-> | ||
145 | pointer-> | ||
146 | signature) ? table_desc-> | ||
147 | pointer->signature : "????", | ||
148 | *(u32 *)table_desc->pointer->signature)); | ||
149 | |||
150 | return_ACPI_STATUS(AE_BAD_SIGNATURE); | ||
151 | } | ||
135 | 152 | ||
136 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 153 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
137 | 154 | ||