From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lv Zheng Subject: [PATCH v2 13/14] ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode Date: Mon, 19 Oct 2015 10:26:02 +0800 Message-ID: <9a0011bd4730c83dddfdbb11437e7b1b3500ccac.1445221165.git.lv.zheng@intel.com> References: <8c1016ca8a570ba7c7a1c9f0f88d73cd83cea490> Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bob Moore List-Id: linux-acpi@vger.kernel.org ACPICA commit 35273add90da19cd8790fdb5735f52e3c9861684 When single step execution is not ended, executing another control methods leads to dead locks around interpreter lock/namespace lock/method serialization lock. So we should only allow one execution from the debugger at same time. Lv Zheng. Link: https://github.com/acpica/acpica/commit/35273add Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- drivers/acpi/acpica/dbexec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index 258e615..d713e2d 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c @@ -370,7 +370,17 @@ acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags) #ifdef ACPI_DEBUG_OUTPUT u32 previous_allocations; u32 allocations; +#endif + /* + * Allow one execution to be performed by debugger or single step + * execution will be dead locked by the interpreter mutexes. + */ + if (acpi_gbl_method_executing) { + acpi_os_printf("Only one debugger execution is allowed.\n"); + return; + } +#ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */ previous_allocations = acpi_db_get_outstanding_allocations(); -- 1.7.10 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753442AbbJSC0n (ORCPT ); Sun, 18 Oct 2015 22:26:43 -0400 Received: from mga03.intel.com ([134.134.136.65]:9580 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386AbbJSC0F (ORCPT ); Sun, 18 Oct 2015 22:26:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,699,1437462000"; d="scan'208";a="829966659" From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, Bob Moore Subject: [PATCH v2 13/14] ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode Date: Mon, 19 Oct 2015 10:26:02 +0800 Message-Id: <9a0011bd4730c83dddfdbb11437e7b1b3500ccac.1445221165.git.lv.zheng@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: <8c1016ca8a570ba7c7a1c9f0f88d73cd83cea490> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACPICA commit 35273add90da19cd8790fdb5735f52e3c9861684 When single step execution is not ended, executing another control methods leads to dead locks around interpreter lock/namespace lock/method serialization lock. So we should only allow one execution from the debugger at same time. Lv Zheng. Link: https://github.com/acpica/acpica/commit/35273add Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- drivers/acpi/acpica/dbexec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index 258e615..d713e2d 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c @@ -370,7 +370,17 @@ acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags) #ifdef ACPI_DEBUG_OUTPUT u32 previous_allocations; u32 allocations; +#endif + /* + * Allow one execution to be performed by debugger or single step + * execution will be dead locked by the interpreter mutexes. + */ + if (acpi_gbl_method_executing) { + acpi_os_printf("Only one debugger execution is allowed.\n"); + return; + } +#ifdef ACPI_DEBUG_OUTPUT /* Memory allocation tracking */ previous_allocations = acpi_db_get_outstanding_allocations(); -- 1.7.10