diff options
author | Lv Zheng <lv.zheng@intel.com> | 2016-06-22 09:20:09 +0800 |
---|---|---|
committer | Lv Zheng <lv.zheng@intel.com> | 2016-06-22 09:20:09 +0800 |
commit | bfe03ffcde8ed56a7eae38ea0b188aeb12f9c52e (patch) | |
tree | 6fb2889db2d29a540e9286f689c299dde0080403 | |
parent | f39a732d2a0575b8a28b3d59f1836c7a3e4aa9cc (diff) | |
download | acpica-bfe03ffcde8ed56a7eae38ea0b188aeb12f9c52e.tar.gz |
Namespace: Fix a regression that MLC support triggers dead lock in dynamic table loading
The new MLC approach invokes MLC per-table basis. But the dynamic loading
support of this is incorrect because of the lock order:
AcpiNsEvaluate
AcpiExEnterIntperter
AcpiNsLoadTable (triggered by Load opcode)
AcpiNsExecModuleCodeList
AcpiExEnterIntperter
The regression is introduced by the following commit:
Commit: 071eff738c59eda1792ac24b3b688b61691d7e7c
Subject: Add per-table execution of module-level code, early region handlers
This patch fixes this regression by unlocking the interpreter lock before
invoking MLC. However the unlocking is done to the AcpiNsLoadTable(), in
which, the interpreter lock should be locked by AcpiNsParseTable() but
wasn't. Reported by Mika Westerberg. Fixed by Lv Zheng.
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
-rw-r--r-- | source/components/executer/exconfig.c | 2 | ||||
-rw-r--r-- | source/components/namespace/nsparse.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 333567fcc..9e8528833 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -191,7 +191,9 @@ AcpiExAddTable ( /* Add the table to the namespace */ + AcpiExExitInterpreter (); Status = AcpiNsLoadTable (TableIndex, ParentNode); + AcpiExEnterInterpreter (); if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ObjDesc); diff --git a/source/components/namespace/nsparse.c b/source/components/namespace/nsparse.c index 6cfdd06fa..692d83760 100644 --- a/source/components/namespace/nsparse.c +++ b/source/components/namespace/nsparse.c @@ -119,6 +119,7 @@ #include "acparser.h" #include "acdispat.h" #include "actables.h" +#include "acinterp.h" #define _COMPONENT ACPI_NAMESPACE @@ -260,6 +261,8 @@ AcpiNsParseTable ( ACPI_FUNCTION_TRACE (NsParseTable); + AcpiExEnterInterpreter (); + /* * AML Parse, pass 1 * @@ -276,7 +279,7 @@ AcpiNsParseTable ( TableIndex, StartNode); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + goto ErrorExit; } /* @@ -293,8 +296,10 @@ AcpiNsParseTable ( TableIndex, StartNode); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + goto ErrorExit; } +ErrorExit: + AcpiExExitInterpreter (); return_ACPI_STATUS (Status); } |