Skip to content

Commit fd305ed

Browse files
author
Lv Zheng
committed
Dispatcher: Fix a mutex issue for method auto serialization
This patch fixes an issue with AcpiDsAutoSerializedMethod(). The parser will invoke AcpiExReleaseAllMutexes(), which in return cause mutexes held in ACPI_ERROR_METHOD() failed. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
1 parent 767ee53 commit fd305ed

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

source/components/dispatcher/dsmethod.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,15 @@ AcpiDsAutoSerializeMethod (
179179
"Method auto-serialization parse [%4.4s] %p\n",
180180
AcpiUtGetNodeName (Node), Node));
181181

182+
AcpiExEnterInterpreter ();
183+
182184
/* Create/Init a root op for the method parse tree */
183185

184186
Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
185187
if (!Op)
186188
{
187-
return_ACPI_STATUS (AE_NO_MEMORY);
189+
Status = AE_NO_MEMORY;
190+
goto Unlock;
188191
}
189192

190193
AcpiPsSetName (Op, Node->Name.Integer);
@@ -196,7 +199,8 @@ AcpiDsAutoSerializeMethod (
196199
if (!WalkState)
197200
{
198201
AcpiPsFreeOp (Op);
199-
return_ACPI_STATUS (AE_NO_MEMORY);
202+
Status = AE_NO_MEMORY;
203+
goto Unlock;
200204
}
201205

202206
Status = AcpiDsInitAmlWalk (WalkState, Op, Node,
@@ -215,6 +219,8 @@ AcpiDsAutoSerializeMethod (
215219
Status = AcpiPsParseAml (WalkState);
216220

217221
AcpiPsDeleteParseTree (Op);
222+
Unlock:
223+
AcpiExExitInterpreter ();
218224
return_ACPI_STATUS (Status);
219225
}
220226

source/components/parser/psparse.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,10 @@ AcpiPsParseAml (
627627
{
628628
/* Either the method parse or actual execution failed */
629629

630+
AcpiExExitInterpreter ();
630631
ACPI_ERROR_METHOD ("Method parse/execution failed",
631632
WalkState->MethodNode, NULL, Status);
633+
AcpiExEnterInterpreter ();
632634

633635
/* Check for possible multi-thread reentrancy problem */
634636

0 commit comments

Comments
 (0)