From patchwork Fri Apr 2 20:37:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 90471 X-Patchwork-Delegate: lenb@kernel.org 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 o32KYdrp025424 for ; Fri, 2 Apr 2010 20:34:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753039Ab0DBUei (ORCPT ); Fri, 2 Apr 2010 16:34:38 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:52918 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752917Ab0DBUeh (ORCPT ); Fri, 2 Apr 2010 16:34:37 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id A8E6E17DE36; Fri, 2 Apr 2010 22:00:54 +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 15400-08; Fri, 2 Apr 2010 22:00:47 +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 CDE23178A60; Fri, 2 Apr 2010 22:00:47 +0200 (CEST) From: "Rafael J. Wysocki" To: Len Brown Subject: [RFC][PATCH] ACPI / ACPICA: Always use the same lock for GPE locking Date: Fri, 2 Apr 2010 22:37:28 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.34-rc3-rjw; KDE/4.3.5; x86_64; ; ) Cc: "Moore, Robert" , Matthew Garrett , ACPI Devel Maling List , pm list , Jesse Barnes MIME-Version: 1.0 Message-Id: <201004022237.28871.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]); Fri, 02 Apr 2010 20:34:40 +0000 (UTC) Index: linux-2.6/drivers/acpi/acpica/evxfevnt.c =================================================================== --- linux-2.6.orig/drivers/acpi/acpica/evxfevnt.c +++ linux-2.6/drivers/acpi/acpica/evxfevnt.c @@ -476,19 +476,13 @@ ACPI_EXPORT_SYMBOL(acpi_clear_event) ******************************************************************************/ acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags) { + acpi_cpu_flags cpu_flags; acpi_status status = AE_OK; struct acpi_gpe_event_info *gpe_event_info; ACPI_FUNCTION_TRACE(acpi_clear_gpe); - /* Use semaphore lock if not executing at interrupt level */ - - if (flags & ACPI_NOT_ISR) { - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } + cpu_flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); /* Ensure that we have a valid GPE number */ @@ -501,9 +495,7 @@ acpi_status acpi_clear_gpe(acpi_handle g status = acpi_hw_clear_gpe(gpe_event_info); unlock_and_exit: - if (flags & ACPI_NOT_ISR) { - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - } + acpi_os_release_lock(acpi_gbl_gpe_lock, cpu_flags); return_ACPI_STATUS(status); } @@ -584,19 +576,13 @@ acpi_status acpi_get_gpe_status(acpi_handle gpe_device, u32 gpe_number, u32 flags, acpi_event_status * event_status) { + acpi_cpu_flags cpu_flags; acpi_status status = AE_OK; struct acpi_gpe_event_info *gpe_event_info; ACPI_FUNCTION_TRACE(acpi_get_gpe_status); - /* Use semaphore lock if not executing at interrupt level */ - - if (flags & ACPI_NOT_ISR) { - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } + cpu_flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); /* Ensure that we have a valid GPE number */ @@ -614,9 +600,7 @@ acpi_get_gpe_status(acpi_handle gpe_devi *event_status |= ACPI_EVENT_FLAG_HANDLE; unlock_and_exit: - if (flags & ACPI_NOT_ISR) { - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - } + acpi_os_release_lock(acpi_gbl_gpe_lock, cpu_flags); return_ACPI_STATUS(status); }