From patchwork Tue Jun 8 08:49:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 104909 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o58926xx027705 for ; Tue, 8 Jun 2010 09:02:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754307Ab0FHJAi (ORCPT ); Tue, 8 Jun 2010 05:00:38 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:37152 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206Ab0FHJAg (ORCPT ); Tue, 8 Jun 2010 05:00:36 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 41B511867DD; Tue, 8 Jun 2010 10:54:35 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10309-08; Tue, 8 Jun 2010 10:54:16 +0200 (CEST) Received: from tosh.localnet (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 3D548186730; Tue, 8 Jun 2010 10:54:16 +0200 (CEST) From: "Rafael J. Wysocki" To: Len Brown Subject: [PATCH 3/5] ACPI / ACPICA: Avoid writing full enable masks to GPE registers Date: Tue, 8 Jun 2010 10:49:45 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.35-rc1-rjw; KDE/4.3.5; x86_64; ; ) Cc: Matthew Garrett , ACPI Devel Maling List , LKML , pm list , "Moore, Robert" , Len Brown , Zhang Rui References: <201006080024.46142.rjw@sisk.pl> <201006081046.48488.rjw@sisk.pl> In-Reply-To: <201006081046.48488.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201006081049.45342.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 08 Jun 2010 09:02:06 +0000 (UTC) Index: linux-2.6/drivers/acpi/acpica/hwgpe.c =================================================================== --- linux-2.6.orig/drivers/acpi/acpica/hwgpe.c +++ linux-2.6/drivers/acpi/acpica/hwgpe.c @@ -118,6 +118,10 @@ acpi_hw_low_set_gpe(struct acpi_gpe_even register_bit = acpi_hw_gpe_register_bit(gpe_event_info, gpe_register_info); switch (action) { + case ACPI_GPE_COND_ENABLE: + if (!(register_bit & gpe_register_info->enable_for_run)) + return (AE_BAD_PARAMETER); + case ACPI_GPE_ENABLE: ACPI_SET_BIT(enable_mask, register_bit); break; @@ -154,23 +158,11 @@ acpi_hw_low_set_gpe(struct acpi_gpe_even acpi_status acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info) { - struct acpi_gpe_register_info *gpe_register_info; acpi_status status; ACPI_FUNCTION_ENTRY(); - /* Get the info block for the entire GPE register */ - - gpe_register_info = gpe_event_info->register_info; - if (!gpe_register_info) { - return (AE_NOT_EXIST); - } - - /* Write the entire GPE (runtime) enable register */ - - status = acpi_hw_write(gpe_register_info->enable_for_run, - &gpe_register_info->enable_address); - + status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_COND_ENABLE); return (status); } Index: linux-2.6/include/acpi/actypes.h =================================================================== --- linux-2.6.orig/include/acpi/actypes.h +++ linux-2.6/include/acpi/actypes.h @@ -667,6 +667,7 @@ typedef u32 acpi_event_status; #define ACPI_GPE_ENABLE 0 #define ACPI_GPE_DISABLE 1 +#define ACPI_GPE_COND_ENABLE 2 /* gpe_types for acpi_enable_gpe and acpi_disable_gpe */