From patchwork Sun Mar 7 23:36:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 83983 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 o27NZ9JD018903 for ; Sun, 7 Mar 2010 23:35:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750959Ab0CGXfH (ORCPT ); Sun, 7 Mar 2010 18:35:07 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:58351 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063Ab0CGXfF (ORCPT ); Sun, 7 Mar 2010 18:35:05 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id DE0A910093A; Mon, 8 Mar 2010 00:09:45 +0100 (CET) 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 19438-05; Mon, 8 Mar 2010 00:09:32 +0100 (CET) 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 14D631749E2; Mon, 8 Mar 2010 00:09:32 +0100 (CET) From: "Rafael J. Wysocki" To: "Moore, Robert" Subject: [RFC][PATCH 2/3] ACPI / ACPICA: Fix locking in acpi_remove_gpe_handler() Date: Mon, 8 Mar 2010 00:36:08 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.33-git-rjw; KDE/4.3.5; x86_64; ; ) Cc: Len Brown , ACPI Devel Maling List , Matthew Garrett References: <201003080034.11053.rjw@sisk.pl> In-Reply-To: <201003080034.11053.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201003080036.08248.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]); Sun, 07 Mar 2010 23:35:09 +0000 (UTC) Index: linux-2.6/drivers/acpi/acpica/evxface.c =================================================================== --- linux-2.6.orig/drivers/acpi/acpica/evxface.c +++ linux-2.6/drivers/acpi/acpica/evxface.c @@ -842,6 +842,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_ return_ACPI_STATUS(AE_BAD_PARAMETER); } + /* Make sure all deferred tasks are completed */ + + acpi_os_wait_events_complete(NULL); + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); @@ -870,15 +874,6 @@ acpi_remove_gpe_handler(acpi_handle gpe_ goto unlock_and_exit; } - /* Make sure all deferred tasks are completed */ - - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - acpi_os_wait_events_complete(NULL); - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - /* Remove the handler */ flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);