summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/tbxfload.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-08-25 05:28:26 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-08-26 00:11:30 +0300
commit4712f71b609d1805b958c0c355b16a995b11ab6e (patch)
treefdc5478b85a78859f593691124051cdf3e338a3b /drivers/acpi/acpica/tbxfload.c
parent40913fe6ea3b733564f0b580cf6c51f5d8fa8158 (diff)
downloadlinux-4712f71b609d1805b958c0c355b16a995b11ab6e.tar.xz
ACPICA: Correctly cleanup after a ACPI table load failure
ACPICA commit ed7769e832de6c7ba90615480d916c85fd100422 If a table load fails, delete all namespace objects created by the table, otherwise these objects will be uninitialized, causing problems later. This appears to be a very rare problem. Also handle the unitialized node problem to prevent possible faults. ACPICA BZ 1185. Link: https://github.com/acpica/acpica/commit/ed7769e8 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/tbxfload.c')
-rw-r--r--drivers/acpi/acpica/tbxfload.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 9682d40ca6ff..7862cf04a164 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -102,6 +102,8 @@ static acpi_status acpi_tb_load_namespace(void)
acpi_status status;
u32 i;
struct acpi_table_header *new_dsdt;
+ u32 tables_loaded = 0;
+ u32 tables_failed = 0;
ACPI_FUNCTION_TRACE(tb_load_namespace);
@@ -159,7 +161,10 @@ static acpi_status acpi_tb_load_namespace(void)
status = acpi_ns_load_table(ACPI_TABLE_INDEX_DSDT, acpi_gbl_root_node);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ ACPI_EXCEPTION((AE_INFO, status, "[DSDT] table load failed"));
+ tables_failed++;
+ } else {
+ tables_loaded++;
}
/* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */
@@ -187,11 +192,29 @@ static acpi_status acpi_tb_load_namespace(void)
/* Ignore errors while loading tables, get as many as possible */
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
- (void)acpi_ns_load_table(i, acpi_gbl_root_node);
+ status = acpi_ns_load_table(i, acpi_gbl_root_node);
+ if (ACPI_FAILURE(status)) {
+ ACPI_EXCEPTION((AE_INFO, status,
+ "[%4.4s] table load failed",
+ &acpi_gbl_root_table_list.tables[i].
+ signature.ascii[0]));
+ tables_failed++;
+ } else {
+ tables_loaded++;
+ }
+
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
}
- ACPI_INFO((AE_INFO, "All ACPI Tables successfully acquired"));
+ if (!tables_failed) {
+ ACPI_INFO((AE_INFO,
+ "All (%u) ACPI AML tables successfully loaded",
+ tables_loaded));
+ } else {
+ ACPI_ERROR((AE_INFO,
+ "%u ACPI AML tables loaded, %u failed",
+ tables_loaded, tables_failed));
+ }
unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);