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 X-Patchwork-Id: 23127 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AB1ED218FC for ; Fri, 10 Jan 2014 22:52:42 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf50671ieb.1 for ; Fri, 10 Jan 2014 14:52:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=TwAzzZZK5gwi65Gwm1PduSxbv8g7xZ5J6AB0FkiYFus=; b=X1Z7xmitfuV5JpwVmvd0hWlBLdGJoFTix3Chhf6JV1yMiczuHm5HicI3b9z9B8zOqf 3xLyfR3s36E5kQmlElFG8ktAeengl3VnyAmlOJmfs5IzOGHIdgc97S+6LvrxRvSmfGi6 Xi0BIKTNHtN78ahJ03cMbYGfO+T7rco3qOQH+ni7uVk2acP73TYEpzILiYRBjVmxSYV+ q5awHh2vkqHqzu3u5nmoNzTWTlGVgMo2FlYjWYKq+mtEsfvyB7Ne1a1qWC2KQQcm92qp 7UoiZMVr6L9BKxBObc6icwUmoB7UKLZPCN8mtbHaw0XSQLTMPb6Qj2eCPZyJQQy4QV27 K/7A== X-Gm-Message-State: ALoCoQlYYr76MzwaJcoiSZvW0Ondl5Bg6O35OOGwT8o0I707VO53MQlSEWrco7GhTPOF3lfHuFPR X-Received: by 10.50.78.166 with SMTP id c6mr2110688igx.1.1389394362008; Fri, 10 Jan 2014 14:52:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.145 with SMTP id u17ls1808424qef.42.gmail; Fri, 10 Jan 2014 14:52:41 -0800 (PST) X-Received: by 10.52.237.228 with SMTP id vf4mr8211687vdc.3.1389394361854; Fri, 10 Jan 2014 14:52:41 -0800 (PST) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx.google.com with ESMTPS id ja16si5778545vec.12.2014.01.10.14.52.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 14:52:41 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.54; Received: by mail-vb0-f54.google.com with SMTP id g10so3593930vbg.41 for ; Fri, 10 Jan 2014 14:52:41 -0800 (PST) X-Received: by 10.52.57.194 with SMTP id k2mr7768397vdq.41.1389394361730; Fri, 10 Jan 2014 14:52:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp122793ved; Fri, 10 Jan 2014 14:52:41 -0800 (PST) X-Received: by 10.50.60.4 with SMTP id d4mr6475696igr.14.1389394360053; Fri, 10 Jan 2014 14:52:40 -0800 (PST) Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com [209.85.223.179]) by mx.google.com with ESMTPS id mv9si14004635icc.94.2014.01.10.14.52.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 14:52:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.179 is neither permitted nor denied by best guess record for domain of al.stone@linaro.org) client-ip=209.85.223.179; Received: by mail-ie0-f179.google.com with SMTP id tp5so14980ieb.24 for ; Fri, 10 Jan 2014 14:52:39 -0800 (PST) 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 Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Al Stone 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.54 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;