From patchwork Tue Sep 30 00:24:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 4999321 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 425F09F3ED for ; Tue, 30 Sep 2014 00:09:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6023320204 for ; Tue, 30 Sep 2014 00:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EFFD201FB for ; Tue, 30 Sep 2014 00:09:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838AbaI3AJQ (ORCPT ); Mon, 29 Sep 2014 20:09:16 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:63356 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751906AbaI3AJO (ORCPT ); Mon, 29 Sep 2014 20:09:14 -0400 Received: from afcl190.neoplus.adsl.tpnet.pl [95.49.63.190] (HELO vostro.rjw.lan) by serwer1319399.home.pl [79.96.170.134] with SMTP (IdeaSmtpServer v0.80) id 22e926e2d9d939f3; Tue, 30 Sep 2014 02:09:13 +0200 From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: Linux Kernel Mailing List , Zhang Rui , Linux PM list , Robert Moore Subject: [PATCH 3/5] ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block() Date: Tue, 30 Sep 2014 02:24:38 +0200 Message-ID: <3372372.EFFo7DnmJF@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.16.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1622293.rpSt5UtDk3@vostro.rjw.lan> References: <1622293.rpSt5UtDk3@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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: Rafael J. Wysocki Since acpi_hw_enable_wakeup_gpe_block() is currently always called after disabling all GPEs, it can actually write zeros to all non-wakeup enable bits unconditionally. That will be useful going forward for disabling runtime GPEs and enabling wakeup GPEs in one go instead of doing that in two steps (disable runtime and enable wakeup) which in theory may lead to a loss of a wakeup event. Signed-off-by: Rafael J. Wysocki --- Bob, please let me know if I can fast-track this. --- drivers/acpi/acpica/hwgpe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/acpi/acpica/hwgpe.c =================================================================== --- linux-pm.orig/drivers/acpi/acpica/hwgpe.c +++ linux-pm/drivers/acpi/acpica/hwgpe.c @@ -396,11 +396,11 @@ acpi_hw_enable_wakeup_gpe_block(struct a /* Examine each GPE Register within the block */ for (i = 0; i < gpe_block->register_count; i++) { - if (!gpe_block->register_info[i].enable_for_wake) { - continue; - } - /* Enable all "wake" GPEs in this register */ + /* + * Enable all "wake" GPEs in this register and disable the + * remaining ones. + */ status = acpi_hw_write(gpe_block->register_info[i].enable_for_wake,