From: Lv Zheng <lv.zheng@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <len.brown@intel.com>
Cc: Lv Zheng <lv.zheng@intel.com>, Lv Zheng <zetalog@gmail.com>,
<linux-kernel@vger.kernel.org>,
linux-acpi@vger.kernel.org, Bob Moore <robert.moore@intel.com>
Subject: [PATCH 04/13] ACPICA: Debugger: Update mutexes used for multithreaded debugger
Date: Thu, 15 Oct 2015 10:08:06 +0800 [thread overview]
Message-ID: <3813385f9e120f9348fccdac68b2bf3fe56a14d2.1444874756.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1444874756.git.lv.zheng@intel.com>
From: Bob Moore <robert.moore@intel.com>
ACPICA commit 6b2701f619040e803313363f516b200e362a9100
Make these mutex objects independent of the deadlock detection mechanism.
This mechanism caused failures with the multithread debugger.
This patch doesn't affect Linux kernel as debugger is currently not fully
functioning in the Linux kernel. And the further debugger cleanups will
take care of handling debugger command signalling correctly instead of
using such kind of mutexes. So it is safe to leave this patch as it is.
Link: https://github.com/acpica/acpica/commit/6b2701f6
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/acpica/acglobal.h | 3 +++
drivers/acpi/acpica/aclocal.h | 4 +---
drivers/acpi/acpica/utdecode.c | 2 --
drivers/acpi/acpica/utmutex.c | 21 +++++++++++++++++++++
include/acpi/platform/acenv.h | 6 +++---
5 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 09f37b5..593de41 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -357,6 +357,9 @@ ACPI_GLOBAL(u16, acpi_gbl_node_type_count_misc);
ACPI_GLOBAL(u32, acpi_gbl_num_nodes);
ACPI_GLOBAL(u32, acpi_gbl_num_objects);
+ACPI_GLOBAL(acpi_mutex, acpi_gbl_db_command_ready);
+ACPI_GLOBAL(acpi_mutex, acpi_gbl_db_command_complete);
+
#endif /* ACPI_DEBUGGER */
/*****************************************************************************
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 8a66fef..918f70d 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -83,10 +83,8 @@ union acpi_parse_object;
#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
-#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */
-#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */
-#define ACPI_MAX_MUTEX 7
+#define ACPI_MAX_MUTEX 5
#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
/* Lock structure for reader/writer interfaces */
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 988e23b..d452a78 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -407,8 +407,6 @@ static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
"ACPI_MTX_Events",
"ACPI_MTX_Caches",
"ACPI_MTX_Memory",
- "ACPI_MTX_CommandComplete",
- "ACPI_MTX_CommandReady"
};
char *acpi_ut_get_mutex_name(u32 mutex_id)
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index 37b8b58..ce406e3 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -108,6 +108,21 @@ acpi_status acpi_ut_mutex_initialize(void)
/* Create the reader/writer lock for namespace access */
status = acpi_ut_create_rw_lock(&acpi_gbl_namespace_rw_lock);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+#ifdef ACPI_DEBUGGER
+
+ /* Debugger Support */
+
+ status = acpi_os_create_mutex(&acpi_gbl_db_command_ready);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+
+ status = acpi_os_create_mutex(&acpi_gbl_db_command_complete);
+#endif
+
return_ACPI_STATUS(status);
}
@@ -147,6 +162,12 @@ void acpi_ut_mutex_terminate(void)
/* Delete the reader/writer lock */
acpi_ut_delete_rw_lock(&acpi_gbl_namespace_rw_lock);
+
+#ifdef ACPI_DEBUGGER
+ acpi_os_delete_mutex(acpi_gbl_db_command_ready);
+ acpi_os_delete_mutex(acpi_gbl_db_command_complete);
+#endif
+
return_VOID;
}
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 15ef08c..056f245 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -304,11 +304,11 @@
* multi-threaded if ACPI_APPLICATION is not set.
*/
#ifndef DEBUGGER_THREADING
-#ifdef ACPI_APPLICATION
-#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
+#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
+#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
#else
-#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
+#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
#endif
#endif /* !DEBUGGER_THREADING */
--
1.7.10
next prev parent reply other threads:[~2015-10-15 2:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 2:07 [PATCH 00/13] ACPICA: 20150930 Release Lv Zheng
2015-10-15 2:07 ` [PATCH 01/13] ACPICA: Remove unnecessary conditional compilation Lv Zheng
2015-10-15 15:51 ` kbuild test robot
2015-10-15 18:33 ` Moore, Robert
2015-10-16 0:59 ` Zheng, Lv
2015-10-16 13:39 ` Rafael J. Wysocki
2015-10-15 2:07 ` [PATCH 02/13] ACPICA: iASL: Add symbolic operator support for Index() operator Lv Zheng
2015-10-15 2:08 ` [PATCH 03/13] ACPICA: Update exception code for "file not found" error Lv Zheng
2015-10-15 2:08 ` Lv Zheng [this message]
2015-10-15 2:08 ` [PATCH 05/13] ACPICA: Update NFIT table to rename a flags field Lv Zheng
2015-10-15 2:08 ` [PATCH 06/13] ACPICA: Improve typechecking, both compile-time and runtime Lv Zheng
2015-10-15 2:08 ` [PATCH 07/13] ACPICA: iASL: General cleanup of the file suffix #defines Lv Zheng
2015-10-15 2:08 ` [PATCH 08/13] ACPICA: Linuxize: Export debugger files to Linux Lv Zheng
2015-10-15 2:08 ` [PATCH 09/13] ACPICA: Debugger: Fix "quit/exit" command by cleaning up user commands termination logic Lv Zheng
2015-10-15 2:08 ` [PATCH 10/13] ACPICA: Debugger: Fix "terminate" command by cleaning up subsystem shutdown logic Lv Zheng
2015-10-15 2:08 ` [PATCH 11/13] ACPI: Enable build of AML interpreter debugger Lv Zheng
2015-10-15 2:09 ` [PATCH 12/13] ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode Lv Zheng
2015-10-15 2:09 ` [PATCH 13/13] ACPICA: Update version to 20150930 Lv Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3813385f9e120f9348fccdac68b2bf3fe56a14d2.1444874756.git.lv.zheng@intel.com \
--to=lv.zheng@intel.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
--cc=zetalog@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®