From patchwork Tue Jun 22 15:25:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 107418 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 o5MFPxDA024068 for ; Tue, 22 Jun 2010 15:25:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755015Ab0FVPZ6 (ORCPT ); Tue, 22 Jun 2010 11:25:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754070Ab0FVPZ6 (ORCPT ); Tue, 22 Jun 2010 11:25:58 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5MFPvdr000649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Jun 2010 11:25:57 -0400 Received: from cavan.codon.org.uk (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5MFPuSZ019968 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 11:25:57 -0400 Received: from 209-6-34-250.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.34.250] 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 1OR5MH-00057D-0W; Tue, 22 Jun 2010 16:25:53 +0100 From: Matthew Garrett To: jbarnes@virtuousgeek.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Garrett Subject: [PATCH] ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe Date: Tue, 22 Jun 2010 11:25:43 -0400 Message-Id: <1277220343-25168-1-git-send-email-mjg@redhat.com> X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 209.6.34.250 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.21 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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]); Tue, 22 Jun 2010 15:25:59 +0000 (UTC) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 1af8081..7167213 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -576,6 +577,14 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) if (flags != base_flags) acpi_pci_osc_support(root, flags); + status = acpi_pci_osc_control_set(root->device->handle, + OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); + + if (ACPI_FAILURE(status)) { + printk(KERN_INFO "Unable to assume PCIe control: Disabling ASPM\n"); + pcie_no_aspm(); + } + return 0; end: