From patchwork Fri Dec 10 22:40:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 399682 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBAMeVeC029074 for ; Fri, 10 Dec 2010 22:40:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474Ab0LJWka (ORCPT ); Fri, 10 Dec 2010 17:40:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55131 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318Ab0LJWk3 (ORCPT ); Fri, 10 Dec 2010 17:40:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBAMeNPm004097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Dec 2010 17:40:27 -0500 Received: from cavan.codon.org.uk (ovpn-113-35.phx2.redhat.com [10.3.113.35]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBAMeLn5011976 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 10 Dec 2010 17:40:22 -0500 Received: from 209-6-41-104.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.41.104] helo=localhost.localdomain) by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PRBdR-00053r-JF; Fri, 10 Dec 2010 22:40:17 +0000 From: Matthew Garrett To: linux-acpi@vger.kernel.org Cc: lenb@kernel.org, linux-pci@vger.kernel.org, Matthew Garrett Subject: [PATCH] PCI: _OSC "supported" field should contain supported features, not enabled ones Date: Fri, 10 Dec 2010 17:40:01 -0500 Message-Id: <1292020801-15629-1-git-send-email-mjg@redhat.com> X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 209.6.41.104 X-SA-Exim-Mail-From: mjg@redhat.com X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Dec 2010 22:40:31 +0000 (UTC) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 96668ad..afb5d08 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -450,7 +450,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) struct acpi_pci_root *root; acpi_handle handle; struct acpi_device *child; - u32 flags, base_flags; + u32 flags; root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); if (!root) @@ -498,10 +498,15 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) device->driver_data = root; /* - * All supported architectures that use ACPI have support for - * PCI domains, so we indicate this in _OSC support capabilities. + * Indicate support for various _OSC capabilities. These match + * what the operating system supports, not what the hardware supports, + * so they shouldn't be conditional on functionality that's been + * blacklisted */ - flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; + flags = OSC_EXT_PCI_CONFIG_SUPPORT | OSC_ACTIVE_STATE_PWR_SUPPORT | + OSC_CLOCK_PWR_CAPABILITY_SUPPORT | + OSC_PCI_SEGMENT_GROUPS_SUPPORT | OSC_MSI_SUPPORT; + acpi_pci_osc_support(root, flags); /* @@ -555,17 +560,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) list_for_each_entry(child, &device->children, node) acpi_pci_bridge_scan(child); - /* Indicate support for various _OSC capabilities. */ - if (pci_ext_cfg_avail(root->bus->self)) - flags |= OSC_EXT_PCI_CONFIG_SUPPORT; - if (pcie_aspm_enabled()) - flags |= OSC_ACTIVE_STATE_PWR_SUPPORT | - OSC_CLOCK_PWR_CAPABILITY_SUPPORT; - if (pci_msi_enabled()) - flags |= OSC_MSI_SUPPORT; - if (flags != base_flags) - acpi_pci_osc_support(root, flags); - pci_acpi_add_bus_pm_notifier(device, root->bus); if (device->wakeup.flags.run_wake) device_set_run_wake(root->bus->bridge, true);