summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/tbxfload.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2016-09-23 06:26:35 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-09-24 03:16:52 +0300
commit9febcdc071aaec30d8dee4a21d91f6c7e9c62503 (patch)
treec215339683f69d02e1d9bac0b9b762f8c24ded88 /drivers/acpi/acpica/tbxfload.c
parent86ec64bc382ad1e0e6bc66f5f705a53e299a3445 (diff)
downloadlinux-9febcdc071aaec30d8dee4a21d91f6c7e9c62503.tar.xz
ACPICA: Tables: Fix "UNLOAD" code path lock issues
ACPICA commit 39227380f5b99c51b897a3ffedd88508aa26789b The previous lock fixes didn't cover "Unload" opcode and table unload APIs, this patch fixes lock issues in the "Unload" code path. BZ 1325, Lv Zheng. Link: https://github.com/acpica/acpica/commit/39227380 Link: https://bugs.acpica.org/show_bug.cgi?id=1325 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 870ad6445466..5569f637f669 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -378,9 +378,9 @@ acpi_status acpi_unload_parent_table(acpi_handle object)
return_ACPI_STATUS(AE_TYPE);
}
- /* Must acquire the interpreter lock during this operation */
+ /* Must acquire the table lock during this operation */
- status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
+ status = acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
@@ -407,8 +407,10 @@ acpi_status acpi_unload_parent_table(acpi_handle object)
/* Ensure the table is actually loaded */
+ (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
if (!acpi_tb_is_table_loaded(i)) {
status = AE_NOT_EXIST;
+ (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
break;
}
@@ -434,10 +436,11 @@ acpi_status acpi_unload_parent_table(acpi_handle object)
status = acpi_tb_release_owner_id(i);
acpi_tb_set_table_loaded_flag(i, FALSE);
+ (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
break;
}
- (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
+ (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
return_ACPI_STATUS(status);
}