From patchwork Thu Aug 9 18:46:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10561687 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85C5E1057 for ; Thu, 9 Aug 2018 18:46:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 757532B849 for ; Thu, 9 Aug 2018 18:46:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69CFD2B85E; Thu, 9 Aug 2018 18:46:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A4602B84C for ; Thu, 9 Aug 2018 18:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbeHIVMk (ORCPT ); Thu, 9 Aug 2018 17:12:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbeHIVMk (ORCPT ); Thu, 9 Aug 2018 17:12:40 -0400 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [104.41.132.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0739521F45; Thu, 9 Aug 2018 18:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533840392; bh=WKFoIviVEhWMRP3J/Sp4WkN7Jf89ifXwS7ZdRx4OmrE=; h=From:To:Cc:Subject:Date:From; b=iD3GTMIznWYJLGutmOz0UubWXbx/X+7y+IBmZjeRCepYQ4fRTICY3AiMXp1ehDXTV didDRk39wdro82mOCfv1HHOtulDnL4vh2lKNdN0Xx5KdUxfPODBy87duXjPlmpvJAL fWaD6zC0K7Z5jTXnUoHNXvGafHiXAofzBk2voN5Q= From: Sinan Kaya To: linux-pci@vger.kernel.org Cc: Sinan Kaya , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org (open list:ACPI), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] PCI/ACPI: correct error message for ASPM disabling Date: Thu, 9 Aug 2018 18:46:22 +0000 Message-Id: <1533840383-7841-1-git-send-email-okaya@kernel.org> X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If _OSC execution fails today for platforms without an _OSC entry, code is printing a misleading message saying disabling ASPM as follows: acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM We need to ensure that platform supports ASPM to begin with. Signed-off-by: Sinan Kaya Reported-by: Michael Kelley --- drivers/acpi/pci_root.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 7433035..9d738e2 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -455,8 +455,13 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm) decode_osc_support(root, "OS supports", support); status = acpi_pci_osc_support(root, support); if (ACPI_FAILURE(status)) { - dev_info(&device->dev, "_OSC failed (%s); disabling ASPM\n", - acpi_format_exception(status)); + char *aspm_msg = ""; + + if (pcie_aspm_support_enabled()) + aspm_msg = "; disabling ASPM"; + + dev_info(&device->dev, "_OSC failed (%s) %s\n", + acpi_format_exception(status), aspm_msg); *no_aspm = 1; return; } From patchwork Thu Aug 9 18:46:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10561689 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6E0413AC for ; Thu, 9 Aug 2018 18:46:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4D352B849 for ; Thu, 9 Aug 2018 18:46:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8DCB2B85E; Thu, 9 Aug 2018 18:46:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FC9F2B849 for ; Thu, 9 Aug 2018 18:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbeHIVMm (ORCPT ); Thu, 9 Aug 2018 17:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbeHIVMl (ORCPT ); Thu, 9 Aug 2018 17:12:41 -0400 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [104.41.132.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F0D22238B; Thu, 9 Aug 2018 18:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533840393; bh=ldCH/WDUXtX8U8JXgdkh9fGjiq5pWBE8UgJPrzCislc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rCqDJTcmChbNgh2oHQrv7lqe9j24b4By7GxpFDg8Y6UGSUhFd0fYfoHiGduMQK9mk SLFkMAQs407k9vBx5hCWW3BiMiIU97lF7bIVCQHFB7MDCF3MU4SngbDH5bMU5HGODK Oj5nV82kCbBFN67fTgVfKHQTNWB0rNmOFlmvLHHI= From: Sinan Kaya To: linux-pci@vger.kernel.org Cc: Sinan Kaya , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org (open list:ACPI), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] PCI/ACPI: allow _OSC presence to be optional for PCI Date: Thu, 9 Aug 2018 18:46:23 +0000 Message-Id: <1533840383-7841-2-git-send-email-okaya@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533840383-7841-1-git-send-email-okaya@kernel.org> References: <1533840383-7841-1-git-send-email-okaya@kernel.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPI Spec 6.0 Section 6.2.11.3 OSC Implementation Example for PCI Host Bridge Devices: For a host bridge device that originates a PCI Express hierarchy, the _OSC interface defined in this section is required. For a host bridge device that originates a PCI/PCI-X bus hierarchy, inclusion of an _OSC object is optional. Allow PCI host bridges to bail out silently if _OSC is not found. Signed-off-by: Sinan Kaya Reported-by: Michael Kelley --- drivers/acpi/pci_root.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 9d738e2..c94ed01 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -421,7 +421,8 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req) } EXPORT_SYMBOL(acpi_pci_osc_control_set); -static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm) +static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, + bool is_pcie) { u32 support, control, requested; acpi_status status; @@ -460,9 +461,14 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm) if (pcie_aspm_support_enabled()) aspm_msg = "; disabling ASPM"; - dev_info(&device->dev, "_OSC failed (%s) %s\n", - acpi_format_exception(status), aspm_msg); *no_aspm = 1; + + /* _OSC is optional for PCI host bridges */ + if ((status == AE_NOT_FOUND) && !is_pcie) + return; + + dev_info(&device->dev, "_OSC failed (%s) %s\n", + acpi_format_exception(status), aspm_msg); return; } @@ -538,6 +544,7 @@ static int acpi_pci_root_add(struct acpi_device *device, acpi_handle handle = device->handle; int no_aspm = 0; bool hotadd = system_state == SYSTEM_RUNNING; + bool is_pcie; root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); if (!root) @@ -595,7 +602,8 @@ static int acpi_pci_root_add(struct acpi_device *device, root->mcfg_addr = acpi_pci_root_get_mcfg_addr(handle); - negotiate_os_control(root, &no_aspm); + is_pcie = strcmp(acpi_device_hid(device), "PNP0A08") == 0; + negotiate_os_control(root, &no_aspm, is_pcie); /* * TBD: Need PCI interface for enumeration/configuration of roots.