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: 2854598 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 763339F4D5 for ; Fri, 6 Sep 2013 17:15:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F6C820318 for ; Fri, 6 Sep 2013 17:15:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBF9620317 for ; Fri, 6 Sep 2013 17:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753Ab3IFRPL (ORCPT ); Fri, 6 Sep 2013 13:15:11 -0400 Received: from mail-ye0-f179.google.com ([209.85.213.179]:42517 "EHLO mail-ye0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304Ab3IFRPK (ORCPT ); Fri, 6 Sep 2013 13:15:10 -0400 Received: by mail-ye0-f179.google.com with SMTP id r6so1123266yen.10 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=NG0kRsFuYxj+t6Wmvebpy3VlpXdCFO4beLg0o2R5ob3CW4mnimwmpIKopF0EMXgpBd n5lzWkQbfm/ZVutAx1HNV3hgeq+NZ3dvOkuYtBp1GPTbluIGg+IAi730ypI2h30DL1vW jRNXyghjCuAJhYVnkYLzCsL+wR+2F3mRU55ObsBr9u6FLSMDuEvrTWhtLfjoP+H2jydD qICgCerjjZeCXWjl6CF/u2CGLEy4VmPaXhpkOLJJQcamtNNqXJivkf05/Sx1de9FHVPC 7cXLqbB3DTNfB2S2jduuB2CMLxefCQm36Za1TNCuEWdMV/swisbm6iU2CaAIIbsBeNIi xIPQ== X-Gm-Message-State: ALoCoQnA8lkGEG+qR/43G5iEnQhWQUT/to1KMawYHzjOPvML7YD8NpCJVTnPL4CemDL26dFiH6mHLTWomd0XXUAfmwwYIs7cTUg/JhSYTkFkj3QkLi0epSm0Eyc9+vAnH8g1rLHQoDTgdZr3Ha13yd7czBR+Y+1LRIijB52KMwZpNKEFogaaH1lceUwOIXa4aY8/F5JTphVsDOkY5MuG+1JzejzU2wD8fk1CIOHnzWJOp87XlKGRzNQ= 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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-pci" 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; } }