From patchwork Fri Jan 10 22:52:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: al.stone@linaro.org X-Patchwork-Id: 3468531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4D7F8C02DC for ; Fri, 10 Jan 2014 22:55:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 803282014A for ; Fri, 10 Jan 2014 22:55:30 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95F182013D for ; Fri, 10 Jan 2014 22:55:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W1kxg-0004G8-Jw; Fri, 10 Jan 2014 22:53:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W1kxG-0005ol-N5; Fri, 10 Jan 2014 22:53:30 +0000 Received: from mail-ig0-f169.google.com ([209.85.213.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W1kwl-0005ji-Lv for linux-arm-kernel@lists.infradead.org; Fri, 10 Jan 2014 22:53:05 +0000 Received: by mail-ig0-f169.google.com with SMTP id hk11so2376856igb.0 for ; Fri, 10 Jan 2014 14:52:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TwAzzZZK5gwi65Gwm1PduSxbv8g7xZ5J6AB0FkiYFus=; b=gIfqlHJ/mDcoWB5plrqB1lWSM/4ermtCPniOLyBS0BG2FA/4LZrG1lP/ZjIAGDTwKo 74FjlYr89mi+tggzqUgOnaBhVeC51/zj642VUqy4R/4Dkr8GTTOn2vh4l+L9LA/Xku5n d8WbvzNmfFgeBhT6QYONxPrggYVxZR31ru8ik5oZa81EGPTmGlaUxF9QNJuIXXSzuX4j VuBw6iCTVRWt6MF7qkzPuWD5nqNCy4mu1tw0wXcuAxhqXnEBuHlNU040Ptp9/yJRls+k yG0cm8HXEhy0Z124aZNaMdBK5GmU7ol5sXwlSt2e239t4Lge9EFHDwyUCjCqiPs5o6NK Virg== X-Gm-Message-State: ALoCoQk+LL6PezLnKMWVcOcqb3Y54yN4BQD1b157AjpcdKpCLhnrCBefGmOYCLDbcfUPJRXUwkL9 X-Received: by 10.50.159.194 with SMTP id xe2mr6446028igb.13.1389394359680; Fri, 10 Jan 2014 14:52:39 -0800 (PST) Received: from fidelio.ahs3.com (74-93-232-46-Colorado.hfc.comcastbusiness.net. [74.93.232.46]) by mx.google.com with ESMTPSA id a1sm4967226igo.0.2014.01.10.14.52.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2014 14:52:39 -0800 (PST) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 6/6] ACPI: make sure ECs do not use the ACPI global lock Date: Fri, 10 Jan 2014 15:52:20 -0700 Message-Id: <1389394340-2680-7-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389394340-2680-1-git-send-email-al.stone@linaro.org> References: <1389394340-2680-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140110_175259_921572_73ED0080 X-CRM114-Status: GOOD ( 15.04 ) X-Spam-Score: -0.1 (/) Cc: patches@linaro.org, Al Stone , linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Al Stone ACPI ECs (Embedded Controllers) are allowed to use the ACPI global lock in legacy mode. Since there is no global lock in hardware reduced mode, make sure that ECs cannot inadvertently use it with older ACPI tables that may have defined an _GLK method for the EC device. Since an individual lock can and should be defined for each EC, access to each EC should still be properly controlled. Signed-off-by: Al Stone --- drivers/acpi/ec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index ba5b56d..3f15110 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -745,9 +745,17 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) if (ACPI_FAILURE(status)) return status; ec->gpe = tmp; - /* Use the global lock for all EC transactions? */ + /* + * Use the global lock for all EC transactions? + * + * If ACPI is in hardware reduced mode, there is no global lock. + * If a _GLK method is defined, it needs to be ignored, just + * in case it returns "true", which could happen if the ASL is + * written incorrectly. + */ tmp = 0; - acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); + if (!acpi_gbl_reduced_hardware) + acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); ec->global_lock = tmp; ec->handle = handle; return AE_CTRL_TERMINATE;