From patchwork Fri Aug 6 01:13:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 117619 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o761HrWM022468 for ; Fri, 6 Aug 2010 01:17:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934289Ab0HFBRt (ORCPT ); Thu, 5 Aug 2010 21:17:49 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:43669 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934290Ab0HFBRq (ORCPT ); Thu, 5 Aug 2010 21:17:46 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 2BF0F18FCE9; Fri, 6 Aug 2010 03:10:32 +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 02028-06; Fri, 6 Aug 2010 03:10:08 +0200 (CEST) Received: from ferrari.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 9F6E118FEF4; Fri, 6 Aug 2010 03:09:50 +0200 (CEST) From: "Rafael J. Wysocki" To: Hidetoshi Seto Subject: [PATCH 9/10] ACPI / PCI: Reorder checks in acpi_pci_osc_control_set() Date: Fri, 6 Aug 2010 03:13:38 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-rjw+; KDE/4.4.4; x86_64; ; ) Cc: Kenji Kaneshige , Jesse Barnes , linux-pci@vger.kernel.org, ACPI Devel Maling List , linux-pm@lists.linux-foundation.org References: <201008060303.51224.rjw@sisk.pl> In-Reply-To: <201008060303.51224.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <201008060313.38590.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, 06 Aug 2010 01:17:57 +0000 (UTC) Index: linux-2.6/drivers/acpi/pci_root.c =================================================================== --- linux-2.6.orig/drivers/acpi/pci_root.c +++ linux-2.6/drivers/acpi/pci_root.c @@ -428,10 +428,6 @@ acpi_status acpi_pci_osc_control_set(acp acpi_handle tmp; struct acpi_pci_root *root; - status = acpi_get_handle(handle, "_OSC", &tmp); - if (ACPI_FAILURE(status)) - return status; - control_req = (flags & OSC_PCI_CONTROL_MASKS); if (!control_req) return AE_TYPE; @@ -440,6 +436,10 @@ acpi_status acpi_pci_osc_control_set(acp if (!root) return AE_NOT_EXIST; + status = acpi_get_handle(handle, "_OSC", &tmp); + if (ACPI_FAILURE(status)) + return status; + mutex_lock(&osc_lock); /* No need to evaluate _OSC if the control was already granted. */ if ((root->osc_control_set & control_req) == control_req)