From patchwork Wed Aug 4 08:41:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hidetoshi Seto X-Patchwork-Id: 116975 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 o748gajr026428 for ; Wed, 4 Aug 2010 08:42:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751351Ab0HDImf (ORCPT ); Wed, 4 Aug 2010 04:42:35 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:49525 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309Ab0HDImd (ORCPT ); Wed, 4 Aug 2010 04:42:33 -0400 Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o748gWlB016079 (envelope-from seto.hidetoshi@jp.fujitsu.com); Wed, 4 Aug 2010 17:42:32 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id DBC9A45DE51; Wed, 4 Aug 2010 17:42:31 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id A727A45DE4C; Wed, 4 Aug 2010 17:42:31 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 742E31DB801B; Wed, 4 Aug 2010 17:42:31 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.249.87.107]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 08EE91DB8013; Wed, 4 Aug 2010 17:42:31 +0900 (JST) Received: from m107.css.fujitsu.com (m107 [127.0.0.1]) by m107.s.css.fujitsu.com (Postfix) with ESMTP id 36EFF670016; Wed, 4 Aug 2010 17:42:30 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.102.27]) by m107.s.css.fujitsu.com (Postfix) with ESMTP id 25CEB670015; Wed, 4 Aug 2010 17:42:29 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from FMVDA2A041[10.124.102.27] by FMVDA2A041 (FujitsuOutboundMailChecker v1.3.1/9992[10.124.102.27]); Wed, 04 Aug 2010 17:42:25 +0900 (JST) Message-ID: <4C5927CB.4070705@jp.fujitsu.com> Date: Wed, 04 Aug 2010 17:41:47 +0900 From: Hidetoshi Seto User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: Kenji Kaneshige CC: "Rafael J. Wysocki" , linux-pm@lists.linux-foundation.org, linux-pci@vger.kernel.org, Jesse Barnes , ACPI Devel Maling List Subject: Re: [linux-pm] [PATCH 7/8] ACPI / PCI: Do not preserve _OSC control bits returned by a query (v2) References: <201008022351.31406.rjw@sisk.pl> <4C57C182.7060407@jp.fujitsu.com> <201008031133.37471.rjw@sisk.pl> <201008032302.33778.rjw@sisk.pl> <4C58FE9A.1040607@jp.fujitsu.com> In-Reply-To: <4C58FE9A.1040607@jp.fujitsu.com> 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]); Wed, 04 Aug 2010 08:42:36 +0000 (UTC) ===== From: Rafael J. Wysocki Subject: ACPI / PCI: Do not preserve _OSC control bits returned by a query (v3) All of the remaining callers of acpi_pci_osc_control_set() either use acpi_pci_root_osc_query() right before it, like pcie_port_acpi_setup(), or ask for control of one feature only, like acpi_get_hp_hw_control_from_firmware(). Thus there is no reason to preserve the _OSC control bits returned by an _OSC query and the osc_control_qry and osc_queried fields of struct acpi_pci_root are not necessary any more. Remove them and modify the code that uses them accordingly. [v3: HS: keep query in acpi_pci_osc_control_set] Signed-off-by: Rafael J. Wysocki Signed-off-by: Hidetoshi Seto --- drivers/acpi/pci_root.c | 13 +++++-------- include/acpi/acpi_bus.h | 3 --- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d3110d6..ec03c19 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -248,10 +248,8 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, status = acpi_pci_run_osc(root->device->handle, capbuf, &result); if (ACPI_SUCCESS(status)) { root->osc_support_set = support; - root->osc_control_qry = result; if (control) *control = result; - root->osc_queried = 1; } return status; } @@ -438,12 +436,11 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags) goto out; /* Need to query controls first before requesting them */ - if (!root->osc_queried) { - status = acpi_pci_query_osc(root, root->osc_support_set, NULL); - if (ACPI_FAILURE(status)) - goto out; - } - if ((root->osc_control_qry & control_req) != control_req) { + result = control_req; + status = acpi_pci_query_osc(root, root->osc_support_set, &result); + if (ACPI_FAILURE(status)) + goto out; + if ((result & control_req) != control_req) { printk(KERN_DEBUG "Firmware did not grant requested _OSC control\n"); status = AE_SUPPORT; diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index baacd98..4de84ce 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -377,9 +377,6 @@ struct acpi_pci_root { u32 osc_support_set; /* _OSC state of support bits */ u32 osc_control_set; /* _OSC state of control bits */ - u32 osc_control_qry; /* the latest _OSC query result */ - - u32 osc_queried:1; /* has _OSC control been queried? */ }; /* helper */