From patchwork Fri Sep 6 17:14:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2854589 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 BCA049F494 for ; Fri, 6 Sep 2013 17:14:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB1D4202F7 for ; Fri, 6 Sep 2013 17:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D580E202C3 for ; Fri, 6 Sep 2013 17:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752412Ab3IFROk (ORCPT ); Fri, 6 Sep 2013 13:14:40 -0400 Received: from mail-yh0-f52.google.com ([209.85.213.52]:64504 "EHLO mail-yh0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752855Ab3IFROj (ORCPT ); Fri, 6 Sep 2013 13:14:39 -0400 Received: by mail-yh0-f52.google.com with SMTP id v1so1341505yhn.11 for ; Fri, 06 Sep 2013 10:14:39 -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=7lvEElJTLk9dh+3uftleoOknXpfqkKlURFmqQ2Hm3ow=; b=ZbzwDfIDQ2U9UV74Khkov0s6qZoReMiu/IXGxpCnOdn+mLy/4WmD7fTfZyoxUlm9wc VsuxtesYNb4N3CDObpETAV5rtMKXORaYGx8Sjx4CThQ/vwsUFqxHIkC38/UJuxkuiIh/ 55VBPAKzrgZiDoTT6kErFntESg/Rs+eBNGt7FI21O8OTM9sJYwNTMkuOMU7j438XrFMf YteyeruH2feGK1oqGNVL9wlxd2aCRQ5yf+FF6JZHNX8zm8JkhrNeSyc3SioIimXGr14h uo3o1NLUASQ8RetuVRgztPRju5YYZcypVDiSaetiVj144++Gp40kZqz2PVkD9DnwhKsG /1aA== 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=7lvEElJTLk9dh+3uftleoOknXpfqkKlURFmqQ2Hm3ow=; b=miMllN9jTgzlZfTr6WhVx3/8g7IULkVdwoPOCk/JhLQdIbpkWi4IMVpTiJ2zOu92mV vaj5W7g9/7tZVq8AiS82vMco8BbFIthqT5lzk6gLazWnSvnzrv+1+hUbR1A3domvj1M1 wfICuwWD2ke4Npz3FvSLgZjETaev19fYGpNxvBs5xR2eoi9Goovr9pbEQjy7DeaObFjp JMlxOBytfqT7iz/fUco7+sC76AM1bibb9l8Pjg3cqsVGvddsVXrecqPTd9ym6fnx6CaA oyHP/sXG0DfNpjHfnUeRauU4s+1qy79IQxgY3P5D55Nog9ScIpgKE2JCeTy6ew42ybF2 SSOg== X-Gm-Message-State: ALoCoQmsHR0frooUNODwBKq2mbqD2Z+ecR+0b7pfCwAl0Tj7H+VmO6FYE2vWVR4UM7mYxk/9XHPgzLVTbrwdEhKnrCt7Cbs6WQojFOjyAaR2BSl9f1rFf2NdYhFK+cGryUhIkV57mESltN6OMZrBmUC11697rqvOrVw6FMNRlvcIyv0H56+B99/dcn43ssmpfN0xx6VjKSdjXeHoL3LDzJFWyaoxOkiv+b0rtTe2QwFbxQ00topg36Q= X-Received: by 10.236.48.101 with SMTP id u65mr1407458yhb.77.1378487679232; Fri, 06 Sep 2013 10:14:39 -0700 (PDT) Received: from localhost ([172.16.53.165]) by mx.google.com with ESMTPSA id v96sm4099345yhp.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 10:14:38 -0700 (PDT) Subject: [PATCH 09/14] PCI/ACPI: Split _OSC "support" and "control" flags into separate variables 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:14:36 -0600 Message-ID: <20130906171436.11482.21353.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 Previously we used "flags" for both: - the bitmask of features we support (segments, ASPM, MSI, etc.), and - the bitmask of features we want to control (native hotplug, AER, etc.) To reduce confusion, this patch splits this into two variables: "support" is the bitmask of features we support, and "control" is the bitmask of features we want to control. No functional change. Signed-off-by: Bjorn Helgaas --- drivers/acpi/pci_root.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 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 3e57f10..3e06d4e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -363,7 +363,7 @@ EXPORT_SYMBOL(acpi_pci_osc_control_set); static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, int *clear_aspm) { - u32 flags, base_flags; + u32 support, base_support, control; acpi_status status; struct acpi_device *device = root->device; acpi_handle handle = device->handle; @@ -372,29 +372,29 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, * All supported architectures that use ACPI have support for * PCI domains, so we indicate this in _OSC support capabilities. */ - flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; - acpi_pci_osc_support(root, flags); + support = base_support = OSC_PCI_SEGMENT_GROUPS_SUPPORT; + acpi_pci_osc_support(root, support); if (pci_ext_cfg_avail()) - flags |= OSC_PCI_EXT_CONFIG_SUPPORT; + support |= OSC_PCI_EXT_CONFIG_SUPPORT; if (pcie_aspm_support_enabled()) { - flags |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT; + support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT; } if (pci_msi_enabled()) - flags |= OSC_PCI_MSI_SUPPORT; - if (flags != base_flags) { - status = acpi_pci_osc_support(root, flags); + support |= OSC_PCI_MSI_SUPPORT; + if (support != base_support) { + status = acpi_pci_osc_support(root, support); if (ACPI_FAILURE(status)) { dev_info(&device->dev, "ACPI _OSC support " "notification failed, disabling PCIe ASPM\n"); *no_aspm = 1; - flags = base_flags; + support = base_support; } } if (!pcie_ports_disabled - && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { - flags = OSC_PCI_EXPRESS_CAPABILITY_CONTROL + && (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; @@ -403,17 +403,18 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, dev_dbg(&device->dev, "PCIe errors handled by BIOS.\n"); else - flags |= OSC_PCI_EXPRESS_AER_CONTROL; + control |= OSC_PCI_EXPRESS_AER_CONTROL; } dev_info(&device->dev, - "Requesting ACPI _OSC control (0x%02x)\n", flags); + "Requesting ACPI _OSC control (0x%02x)\n", control); - status = acpi_pci_osc_control_set(handle, &flags, + 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", flags); + "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 @@ -425,7 +426,7 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, dev_info(&device->dev, "ACPI _OSC request failed (%s), " "returned control mask: 0x%02x\n", - acpi_format_exception(status), flags); + acpi_format_exception(status), control); dev_info(&device->dev, "ACPI _OSC control for PCIe not granted, disabling ASPM\n"); /* @@ -440,7 +441,7 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, } else { dev_info(&device->dev, "Unable to request _OSC control " - "(_OSC support mask: 0x%02x)\n", flags); + "(_OSC support mask: 0x%02x)\n", support); } }