From patchwork Fri Sep 6 17:15:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2854596 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4D9369F494 for ; Fri, 6 Sep 2013 17:15:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9AC220316 for ; Fri, 6 Sep 2013 17:15:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2E83202E8 for ; Fri, 6 Sep 2013 17:15:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754956Ab3IFRPL (ORCPT ); Fri, 6 Sep 2013 13:15:11 -0400 Received: from mail-ye0-f181.google.com ([209.85.213.181]:61008 "EHLO mail-ye0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753Ab3IFRPJ (ORCPT ); Fri, 6 Sep 2013 13:15:09 -0400 Received: by mail-ye0-f181.google.com with SMTP id r14so390283yen.40 for ; Fri, 06 Sep 2013 10:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=YsppEEQWRMNE1KZlaVyIHd61RGEUKTyS8+J1i67kW/M=; b=PZLMiDzumsv3tenxSv6kzojWmlKkQ2zB5wNqB8Xj6P9A5PqGvXsLfnqN0eTMQWN8DK xQd2SLsRfEePrxHnwCCBsFXYChrviS7gcLgtT1zsSajAYs1QcgAB+P3YLSeq7Z2CbhJs ibSjSOx+bW628YZupeuNl/EIIU5piLklOXXC5k3K32nYrwGpDz4L/jrUFlzWke1wgUF6 LRpU2WgNiHMoJmZWhMAg2EmzMepMHq5/Qaq8/PYrFRqvecoRqcseV/2cNTlHZwF4W+GK bgKXea8B/BvHrTfABefthYkcj+cG55c8B+whwxgKFN65FeuB4aXgkAPoD/FfdYi23ZUg gwLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=YsppEEQWRMNE1KZlaVyIHd61RGEUKTyS8+J1i67kW/M=; b=T1wb3zGYbp/Fm9vyfTuOls+s7CvCR9ibSkauySVVduIWkV4np9Klqx7FAR8Eq6y+aF w6Bcm3cw2oXUENXAXCxIUwEbMK0Z0cr7tbuTWP6KR6sLItpWXvbM6C7lUTQTqW8+BUCX 71dF/eJ2oABWt8wCTZLQuKnqPBemA9OrpJKwU7Pm/POR0zmIL+gBJ27PeapN9b9NWnns 00hd4MU9L8cneRiYturovgqLd8UpqMz8JBLW9AFM4lH5krpL1A+ESf1uXU+YiXKRViB4 Sk0HR3EBK/qSVjifNOf8Osya2TpD/Wvr33uyHWgaRCPd+TNCvd3cb60j5MJx4y4epTuz 9r3A== X-Gm-Message-State: ALoCoQnwr38+tAr9ttKF76tZlMSlVG1IvIOP9ezJNvKsdbYVy+hdg7g8aUHT/aRBycQu15iepUgUhaeBEi08ghcG8dSOjDDQMzZ1U+8uU0lcUFjH+Eerx3JK2efx0C3+MXW+x5BLhBUBw44wALVpO2yIFwFYJRbtPlbAF2zwC+Hgyj1VzwMMMOUhBnSjppFbjmNXaWVxUAAbuYsuYqo2BpWQuOowm1ljKg== X-Received: by 10.236.6.199 with SMTP id 47mr42744yhn.127.1378487709136; Fri, 06 Sep 2013 10:15:09 -0700 (PDT) Received: from localhost ([172.16.53.165]) by mx.google.com with ESMTPSA id r1sm4056743yhf.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 10:15:08 -0700 (PDT) Subject: [PATCH 13/14] PCI/ACPI: Separate out _OSC "we don't support enough services" path To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Len Brown Date: Fri, 06 Sep 2013 11:15:06 -0600 Message-ID: <20130906171506.11482.80881.stgit@bhelgaas-glaptop> In-Reply-To: <20130906171010.11482.34235.stgit@bhelgaas-glaptop> References: <20130906171010.11482.34235.stgit@bhelgaas-glaptop> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Test the services we support (extended config space, ASPM, MSI) separately so we can give a better message. Previously we said "Unable to request _OSC control..."; now we'll say "we support %#02x but %#02x are required". Signed-off-by: Bjorn Helgaas --- drivers/acpi/pci_root.c | 84 ++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 42 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 68e5a18..65aefcf 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -392,55 +392,55 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, return; } - if ((support & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { - control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL - | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL - | OSC_PCI_EXPRESS_PME_CONTROL; - - if (pci_aer_available()) { - if (aer_acpi_firmware_first()) - dev_dbg(&device->dev, - "PCIe errors handled by BIOS.\n"); - else - control |= OSC_PCI_EXPRESS_AER_CONTROL; - } + if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) { + dev_info(&device->dev, "Not requesting _OSC control (we support %#02x but %#02x are required)\n", + support, ACPI_PCIE_REQ_SUPPORT); + return; + } + + control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL + | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL + | OSC_PCI_EXPRESS_PME_CONTROL; + + if (pci_aer_available()) { + if (aer_acpi_firmware_first()) + dev_dbg(&device->dev, + "PCIe errors handled by BIOS.\n"); + else + control |= OSC_PCI_EXPRESS_AER_CONTROL; + } + dev_info(&device->dev, + "Requesting ACPI _OSC control (0x%02x)\n", control); + + status = acpi_pci_osc_control_set(handle, &control, + OSC_PCI_EXPRESS_CAPABILITY_CONTROL); + if (ACPI_SUCCESS(status)) { dev_info(&device->dev, - "Requesting ACPI _OSC control (0x%02x)\n", control); - - status = acpi_pci_osc_control_set(handle, &control, - OSC_PCI_EXPRESS_CAPABILITY_CONTROL); - if (ACPI_SUCCESS(status)) { - dev_info(&device->dev, - "ACPI _OSC control (0x%02x) granted\n", - control); - if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { - /* - * We have ASPM control, but the FADT indicates - * that it's unsupported. Clear it. - */ - *clear_aspm = 1; - } - } else { - dev_info(&device->dev, - "ACPI _OSC request failed (%s), " - "returned control mask: 0x%02x\n", - acpi_format_exception(status), control); - dev_info(&device->dev, - "ACPI _OSC control for PCIe not granted, disabling ASPM\n"); + "ACPI _OSC control (0x%02x) granted\n", + control); + if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { /* - * We want to disable ASPM here, but aspm_disabled - * needs to remain in its state from boot so that we - * properly handle PCIe 1.1 devices. So we set this - * flag here, to defer the action until after the ACPI - * root scan. + * We have ASPM control, but the FADT indicates + * that it's unsupported. Clear it. */ - *no_aspm = 1; + *clear_aspm = 1; } } else { dev_info(&device->dev, - "Unable to request _OSC control " - "(_OSC support mask: 0x%02x)\n", support); + "ACPI _OSC request failed (%s), " + "returned control mask: 0x%02x\n", + acpi_format_exception(status), control); + dev_info(&device->dev, + "ACPI _OSC control for PCIe not granted, disabling ASPM\n"); + /* + * We want to disable ASPM here, but aspm_disabled + * needs to remain in its state from boot so that we + * properly handle PCIe 1.1 devices. So we set this + * flag here, to defer the action until after the ACPI + * root scan. + */ + *no_aspm = 1; } }