From patchwork Thu May 24 20:45:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 161201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 35344B6EE6 for ; Fri, 25 May 2012 06:41:01 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757574Ab2EXUko (ORCPT ); Thu, 24 May 2012 16:40:44 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:35699 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563Ab2EXUkn (ORCPT ); Thu, 24 May 2012 16:40:43 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 4312F1D71F8; Thu, 24 May 2012 21:54:30 +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 16915-08; Thu, 24 May 2012 21:54:21 +0200 (CEST) Received: from ferrari.rjw.lan (62-121-64-87.home.aster.pl [62.121.64.87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 8DC091D70B4; Thu, 24 May 2012 21:54:21 +0200 (CEST) From: "Rafael J. Wysocki" To: Bjorn Helgaas Subject: [PATCH] PCI / ACPI: Do not request control of ASPM if the BIOS has disabled it Date: Thu, 24 May 2012 22:45:45 +0200 User-Agent: KMail/1.13.6 (Linux/3.4.0+; KDE/4.6.0; x86_64; ; ) Cc: ACPI Devel Mailing List , LKML , linux-pci@vger.kernel.org, Len Brown , Wei Kong , Jean Delvare , Matthew Garrett MIME-Version: 1.0 Message-Id: <201205242245.45888.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Rafael J. Wysocki We want to report that the kernel supports ASPM to the BIOS even if the BIOS signals us that it doesn't. So, we need the flags to include (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) before calling acpi_pci_osc_support(root, flags) in acpi_pci_root_add() (unless there's a command line telling us that ASPM is not to be supported). However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly. Reported-and-tested-by: Wei Kong Signed-off-by: Rafael J. Wysocki --- -stable material, I think. Thanks, Rafael --- drivers/acpi/pci_root.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/acpi/pci_root.c =================================================================== --- linux.orig/drivers/acpi/pci_root.c +++ linux/drivers/acpi/pci_root.c @@ -574,6 +574,10 @@ static int __devinit acpi_pci_root_add(s if (flags != base_flags) acpi_pci_osc_support(root, flags); + if (!pcie_aspm_enabled()) + flags &= ~(OSC_ACTIVE_STATE_PWR_SUPPORT | + OSC_CLOCK_PWR_CAPABILITY_SUPPORT); + if (!pcie_ports_disabled && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL