From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbbL2FyF (ORCPT ); Tue, 29 Dec 2015 00:54:05 -0500 Received: from mga14.intel.com ([192.55.52.115]:42491 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbbL2FyB (ORCPT ); Tue, 29 Dec 2015 00:54:01 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,493,1444719600"; d="scan'208";a="625069349" From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, "David E. Box" , Bob Moore Subject: [PATCH 05/42] ACPICA: Fix SyncLevel support interaction with method auto-serialization Date: Tue, 29 Dec 2015 13:53:57 +0800 Message-Id: <1ff2ab61afc190738c60815e45f1a8b205dcc477.1451367388.git.lv.zheng@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "David E. Box" ACPICA commit 253e3c03efc1a495d2aa61eee09ab1d0842a3dce The control method auto-serialization can interfere with existing ASL code that makes use of Mutex/Method SyncLevel support. This change makes the auto-serialization transparent to the SyncLevel support and management. David Box. Link: https://github.com/acpica/acpica/commit/253e3c03 Signed-off-by: David E. Box Signed-off-by: Bob Moore Signed-off-by: Lv Zheng --- drivers/acpi/acpica/dsmethod.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index bc32f31..49ba082 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c @@ -411,8 +411,19 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, obj_desc->method.mutex->mutex.thread_id = walk_state->thread->thread_id; - walk_state->thread->current_sync_level = - obj_desc->method.sync_level; + + /* + * Update the current sync_level only if this is not an auto- + * serialized method. In the auto case, we have to ignore + * the sync level for the method mutex (created for the + * auto-serialization) because we have no idea of what the + * sync level should be. Therefore, just ignore it. + */ + if (!(obj_desc->method.info_flags & + ACPI_METHOD_IGNORE_SYNC_LEVEL)) { + walk_state->thread->current_sync_level = + obj_desc->method.sync_level; + } } else { obj_desc->method.mutex->mutex. original_sync_level = -- 1.7.10