All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zheng, Lv" <lv.zheng@intel.com>
To: "Deak, Imre" <imre.deak@intel.com>,
	"Moore, Robert" <robert.moore@intel.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"devel@acpica.org" <devel@acpica.org>
Subject: RE: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
Date: Fri, 21 Oct 2016 19:46:01 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886A256F5B@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1476913001.7633.13.camel@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

Hi, Imre

> From: Deak, Imre
> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
> 
> Hi,
> 
> after upgrading to 4.9-rc1 I get the following errors occasionally
> during boot and suspend-to-ram on an APL system:
> 
> [   59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-330)
> [   59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> [   59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [   59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node ffff8802770b7dc0),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [   59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
> 
> Other than these error messages, booting and suspend/resume seems to work ok.
> Bisecting points to
> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> Author: Lv Zheng <lv.zheng@intel.com>
> Date:   Wed Sep 7 14:07:10 2016 +0800
> 
>     ACPICA: Namespace: Fix dynamic table loading issues
> 
> Reverting this on top of 4.9-rc1 gets rid of the error messages.

I checked the code, only found one issue.
And I'm not sure if it is related.
Please send me the full dmesg containing the errors and the acpidump output.

Please give the fix a try (see attachment).
I'm sorry for sending fix patch using attachment.
It's not convenient for me due to my current working environment.

Thanks and best regards
Lv

[-- Attachment #2: lv-lockx.patch --]
[-- Type: application/octet-stream, Size: 4138 bytes --]

From 5f919f66c147c9fd4ce0a3c814480ad58479d252 Mon Sep 17 00:00:00 2001
From: Lv Zheng <lv.zheng@intel.com>
Date: Sat, 22 Oct 2016 01:41:03 +0800
From: Lv Zheng <lv.zheng@intel.com>
Subject: [PATCH 0] ACPICA: Dispatcher: Tune interpreter lock around acpi_ev_initialize_region()

In code path of acpi_ev_initialize_region(), there are namespace modification
code unlocked. This patch tunes the code to make sure such modification are
locked. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 dsinit.c   |   13 +++++--------
 dswload2.c |    2 --
 evrgnini.c |    3 +++
 nsload.c   |    2 ++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -Nurp linux.before/drivers/acpi/acpica/dsinit.c linux.after/drivers/acpi/acpica/dsinit.c
--- linux.before/drivers/acpi/acpica/dsinit.c	2016-10-22 01:50:09.496430502 +0800
+++ linux.after/drivers/acpi/acpica/dsinit.c	2016-10-22 01:50:05.976430479 +0800
@@ -46,6 +46,7 @@
 #include "acdispat.h"
 #include "acnamesp.h"
 #include "actables.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsinit")
@@ -140,7 +141,9 @@ acpi_ds_init_one_object(acpi_handle obj_
 
 			/* Parse/scan method and serialize it if necessary */
 
+			acpi_ex_exit_interpreter();
 			acpi_ds_auto_serialize_method(node, obj_desc);
+			acpi_ex_enter_interpreter();
 			if (obj_desc->method.
 			    info_flags & ACPI_METHOD_SERIALIZED) {
 
@@ -214,23 +217,17 @@ acpi_ds_initialize_objects(u32 table_ind
 
 	/* Walk entire namespace from the supplied root */
 
-	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
-	}
-
 	/*
 	 * We don't use acpi_walk_namespace since we do not want to acquire
 	 * the namespace reader lock.
 	 */
 	status =
 	    acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
-				   ACPI_NS_WALK_UNLOCK, acpi_ds_init_one_object,
-				   NULL, &info, NULL);
+				   0, acpi_ds_init_one_object, NULL, &info,
+				   NULL);
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));
 	}
-	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
 	status = acpi_get_table_by_index(table_index, &table);
 	if (ACPI_FAILURE(status)) {
diff -Nurp linux.before/drivers/acpi/acpica/dswload2.c linux.after/drivers/acpi/acpica/dswload2.c
--- linux.before/drivers/acpi/acpica/dswload2.c	2016-10-22 01:50:09.480430502 +0800
+++ linux.after/drivers/acpi/acpica/dswload2.c	2016-10-22 01:50:05.960430479 +0800
@@ -607,11 +607,9 @@ acpi_status acpi_ds_load2_end_op(struct
 				}
 			}
 
-			acpi_ex_exit_interpreter();
 			status =
 			    acpi_ev_initialize_region
 			    (acpi_ns_get_attached_object(node));
-			acpi_ex_enter_interpreter();
 			break;
 
 		case AML_NAME_OP:
diff -Nurp linux.before/drivers/acpi/acpica/evrgnini.c linux.after/drivers/acpi/acpica/evrgnini.c
--- linux.before/drivers/acpi/acpica/evrgnini.c	2016-10-22 01:50:09.484430502 +0800
+++ linux.after/drivers/acpi/acpica/evrgnini.c	2016-10-22 01:50:05.964430479 +0800
@@ -45,6 +45,7 @@
 #include "accommon.h"
 #include "acevents.h"
 #include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evrgnini")
@@ -594,8 +595,10 @@ acpi_status acpi_ev_initialize_region(un
 				 * Tell all users that this region is usable by
 				 * running the _REG method
 				 */
+				acpi_ex_exit_interpreter();
 				(void)acpi_ev_execute_reg_method(region_obj,
 								 ACPI_REG_CONNECT);
+				acpi_ex_enter_interpreter();
 				return_ACPI_STATUS(AE_OK);
 			}
 		}
diff -Nurp linux.before/drivers/acpi/acpica/nsload.c linux.after/drivers/acpi/acpica/nsload.c
--- linux.before/drivers/acpi/acpica/nsload.c	2016-10-22 01:50:09.496430502 +0800
+++ linux.after/drivers/acpi/acpica/nsload.c	2016-10-22 01:50:05.976430479 +0800
@@ -137,7 +137,9 @@ unlock:
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "**** Begin Table Object Initialization\n"));
 
+	acpi_ex_enter_interpreter();
 	status = acpi_ds_initialize_objects(table_index, node);
+	acpi_ex_exit_interpreter();
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "**** Completed Table Object Initialization\n"));

WARNING: multiple messages have this Message-ID (diff)
From: Zheng, Lv <lv.zheng at intel.com>
To: devel@acpica.org
Subject: Re: [Devel] 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
Date: Fri, 21 Oct 2016 19:46:01 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886A256F5B@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: 1476913001.7633.13.camel@intel.com

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

Hi, Imre

> From: Deak, Imre
> Subject: 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS
> 
> Hi,
> 
> after upgrading to 4.9-rc1 I get the following errors occasionally
> during boot and suspend-to-ram on an APL system:
> 
> [   59.513434] ACPI Error: [TMP_] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dswload2-330)
> [   59.513446] ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20160831/psobject-227)
> [   59.513469] ACPI Error: Method parse/execution failed [\_SB.PCI0.SCPG] (Node ffff8802770b7bb8),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [   59.515415] ACPI Error: Method parse/execution failed [\_SB.PCI0.SDHA._PS3] (Node ffff8802770b7dc0),
> AE_ALREADY_EXISTS (20160831/psparse-543)
> [   59.517118] ACPI: Marking method _PS3 as Serialized because of AE_ALREADY_EXISTS error
> 
> Other than these error messages, booting and suspend/resume seems to work ok.
> Bisecting points to
> commit 74f51b80a0c4ff84fbeb7f12ea43ce66934d29aa
> Author: Lv Zheng <lv.zheng(a)intel.com>
> Date:   Wed Sep 7 14:07:10 2016 +0800
> 
>     ACPICA: Namespace: Fix dynamic table loading issues
> 
> Reverting this on top of 4.9-rc1 gets rid of the error messages.

I checked the code, only found one issue.
And I'm not sure if it is related.
Please send me the full dmesg containing the errors and the acpidump output.

Please give the fix a try (see attachment).
I'm sorry for sending fix patch using attachment.
It's not convenient for me due to my current working environment.

Thanks and best regards
Lv

[-- Attachment #2: lv-lockx.patch --]
[-- Type: application/octet-stream, Size: 4138 bytes --]

From 5f919f66c147c9fd4ce0a3c814480ad58479d252 Mon Sep 17 00:00:00 2001
From: Lv Zheng <lv.zheng@intel.com>
Date: Sat, 22 Oct 2016 01:41:03 +0800
From: Lv Zheng <lv.zheng@intel.com>
Subject: [PATCH 0] ACPICA: Dispatcher: Tune interpreter lock around acpi_ev_initialize_region()

In code path of acpi_ev_initialize_region(), there are namespace modification
code unlocked. This patch tunes the code to make sure such modification are
locked. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 dsinit.c   |   13 +++++--------
 dswload2.c |    2 --
 evrgnini.c |    3 +++
 nsload.c   |    2 ++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -Nurp linux.before/drivers/acpi/acpica/dsinit.c linux.after/drivers/acpi/acpica/dsinit.c
--- linux.before/drivers/acpi/acpica/dsinit.c	2016-10-22 01:50:09.496430502 +0800
+++ linux.after/drivers/acpi/acpica/dsinit.c	2016-10-22 01:50:05.976430479 +0800
@@ -46,6 +46,7 @@
 #include "acdispat.h"
 #include "acnamesp.h"
 #include "actables.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsinit")
@@ -140,7 +141,9 @@ acpi_ds_init_one_object(acpi_handle obj_
 
 			/* Parse/scan method and serialize it if necessary */
 
+			acpi_ex_exit_interpreter();
 			acpi_ds_auto_serialize_method(node, obj_desc);
+			acpi_ex_enter_interpreter();
 			if (obj_desc->method.
 			    info_flags & ACPI_METHOD_SERIALIZED) {
 
@@ -214,23 +217,17 @@ acpi_ds_initialize_objects(u32 table_ind
 
 	/* Walk entire namespace from the supplied root */
 
-	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
-	}
-
 	/*
 	 * We don't use acpi_walk_namespace since we do not want to acquire
 	 * the namespace reader lock.
 	 */
 	status =
 	    acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
-				   ACPI_NS_WALK_UNLOCK, acpi_ds_init_one_object,
-				   NULL, &info, NULL);
+				   0, acpi_ds_init_one_object, NULL, &info,
+				   NULL);
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));
 	}
-	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
 	status = acpi_get_table_by_index(table_index, &table);
 	if (ACPI_FAILURE(status)) {
diff -Nurp linux.before/drivers/acpi/acpica/dswload2.c linux.after/drivers/acpi/acpica/dswload2.c
--- linux.before/drivers/acpi/acpica/dswload2.c	2016-10-22 01:50:09.480430502 +0800
+++ linux.after/drivers/acpi/acpica/dswload2.c	2016-10-22 01:50:05.960430479 +0800
@@ -607,11 +607,9 @@ acpi_status acpi_ds_load2_end_op(struct
 				}
 			}
 
-			acpi_ex_exit_interpreter();
 			status =
 			    acpi_ev_initialize_region
 			    (acpi_ns_get_attached_object(node));
-			acpi_ex_enter_interpreter();
 			break;
 
 		case AML_NAME_OP:
diff -Nurp linux.before/drivers/acpi/acpica/evrgnini.c linux.after/drivers/acpi/acpica/evrgnini.c
--- linux.before/drivers/acpi/acpica/evrgnini.c	2016-10-22 01:50:09.484430502 +0800
+++ linux.after/drivers/acpi/acpica/evrgnini.c	2016-10-22 01:50:05.964430479 +0800
@@ -45,6 +45,7 @@
 #include "accommon.h"
 #include "acevents.h"
 #include "acnamesp.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evrgnini")
@@ -594,8 +595,10 @@ acpi_status acpi_ev_initialize_region(un
 				 * Tell all users that this region is usable by
 				 * running the _REG method
 				 */
+				acpi_ex_exit_interpreter();
 				(void)acpi_ev_execute_reg_method(region_obj,
 								 ACPI_REG_CONNECT);
+				acpi_ex_enter_interpreter();
 				return_ACPI_STATUS(AE_OK);
 			}
 		}
diff -Nurp linux.before/drivers/acpi/acpica/nsload.c linux.after/drivers/acpi/acpica/nsload.c
--- linux.before/drivers/acpi/acpica/nsload.c	2016-10-22 01:50:09.496430502 +0800
+++ linux.after/drivers/acpi/acpica/nsload.c	2016-10-22 01:50:05.976430479 +0800
@@ -137,7 +137,9 @@ unlock:
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "**** Begin Table Object Initialization\n"));
 
+	acpi_ex_enter_interpreter();
 	status = acpi_ds_initialize_objects(table_index, node);
+	acpi_ex_exit_interpreter();
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "**** Completed Table Object Initialization\n"));

  parent reply	other threads:[~2016-10-21 19:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19 21:36 4.9-rc1: [TMP_] ACPI namespace lookup failure, AE_ALREADY_EXISTS Imre Deak
2016-10-20 16:45 ` Zheng, Lv
2016-10-20 16:45   ` [Devel] " Zheng, Lv
2016-10-20 18:44 ` Zheng, Lv
2016-10-20 18:44   ` [Devel] " Zheng, Lv
2016-10-20 21:16   ` Rafael J. Wysocki
2016-10-20 23:05     ` Zheng, Lv
2016-10-20 23:05       ` [Devel] " Zheng, Lv
2016-10-21 19:46 ` Zheng, Lv [this message]
2016-10-21 19:46   ` Zheng, Lv
     [not found]   ` <1477216090.7258.9.camel@intel.com>
2016-10-24  6:10     ` Zheng, Lv
2016-10-24  6:10       ` [Devel] " Zheng, Lv
2016-10-24  7:35     ` Zheng, Lv
2016-10-24  7:35       ` [Devel] " Zheng, Lv
2016-10-27 15:31       ` Moore, Robert
2016-10-27 15:31         ` [Devel] " Moore, Robert
2016-10-25  1:14     ` Zheng, Lv
2016-10-25  1:14       ` [Devel] " Zheng, Lv
2016-10-25 12:48       ` Imre Deak
2016-10-25 14:26         ` Zheng, Lv
2016-10-25 14:26           ` [Devel] " Zheng, Lv

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=1AE640813FDE7649BE1B193DEA596E886A256F5B@SHSMSX101.ccr.corp.intel.com \
    --to=lv.zheng@intel.com \
    --cc=devel@acpica.org \
    --cc=imre.deak@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.