From patchwork Wed Jan 29 18:19:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3553701 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1DFAC02DC for ; Wed, 29 Jan 2014 18:21:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 093792018E for ; Wed, 29 Jan 2014 18:21:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F6092018B for ; Wed, 29 Jan 2014 18:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbaA2STJ (ORCPT ); Wed, 29 Jan 2014 13:19:09 -0500 Received: from mail-ie0-f177.google.com ([209.85.223.177]:38331 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753326AbaA2STG (ORCPT ); Wed, 29 Jan 2014 13:19:06 -0500 Received: by mail-ie0-f177.google.com with SMTP id at1so2437501iec.36 for ; Wed, 29 Jan 2014 10:19:06 -0800 (PST) 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=y0CbTTzMZxB0uifYTCxOdioy0mivs10YP68iBFsjU2o=; b=AbGCbfwZGapkVCKsWbaFLIDtk47b24vVwveMyflARxyS4OLFCcT1cP631NEUo5xjfQ TKra76k2dkb9fKVXx1CNJv6Wmq5ZTT+NVcmlhp5ZREG+mg0I3eaQoDT0ibJ6DcMeVXch zrLPNjxY86bsPQTOuZYv7MrsQqS0ikV+/jRGMnZmQHgMn9TrAzqDXJoIxI/vtXhQlWsR tnG0WrSfPepfj/KeuLdspebS4plgJqpK5gXbm6MWy5rOGzGQhnIop2QAZBY4cw2AQy3/ YBxV96HEn0kT6wTzKR3DXKgxNOa30O+z+aHOAPwsdYHa2h0DDnF3WAyNwLQyM5vjxQIC Q1uw== 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=y0CbTTzMZxB0uifYTCxOdioy0mivs10YP68iBFsjU2o=; b=hjMt7Birn1XUSq0761NF4+wqHodyEjhnMrd1ONKzzJEnrlLwDH8dFGwFVTBP4F/L1i psvJOavw+tpH+yU82GU3hZ+prpmdXskeMJtzeDZCzdr7ZKf9KLj+aIOMwJnYY7EhGWR/ uy2fsDuRvbzSyFbFjFOEi93Wcw973fvCgPlwr4A5Vf2FLK1ejJyDyQo6fMZbHI3NQVFA G7QLxDwxV3AOaBtBNCtzHVJECJKmaV9edhTHXIAOqJSq6wn1gKzoritMcYaGEt4p73BC x+OKnODyItenKiWz9IkHIR2/DK9wjbWwT5GluHNU215435q1G3KrSm90NcqzGTXxrY+U swAg== X-Gm-Message-State: ALoCoQlcx8blLPZRbHfSISk6duVH9YYsaZeGSvXZ0fAelMNqs7Rbz3Gs+4ccghJ/v9OSPQUkw+7wFUKW4l/zHoCu/XuwZ89msdkUcLXL04IcLLZTPG2rpi6TvwUHnnFv6+4uuL3C0meKA18EQMnww4df1Gi4CEBy0U2vOtCgMXXMiRUCVVkKFTO6nm0tNfC6WYT3k9VYXukQijqnalEuMEkxUBaryYwlVrCL5KHkTPBL3u1yAds3eCw= X-Received: by 10.50.194.131 with SMTP id hw3mr10242485igc.4.1391019545930; Wed, 29 Jan 2014 10:19:05 -0800 (PST) Received: from localhost ([172.29.123.160]) by mx.google.com with ESMTPSA id x6sm70378766igb.3.2014.01.29.10.19.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 10:19:04 -0800 (PST) Subject: [PATCH 13/17] ia64: Remove acpi_get_pxm() usage To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 29 Jan 2014 11:19:02 -0700 Message-ID: <20140129181902.15476.86815.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140129174106.15476.7075.stgit@bhelgaas-glaptop.roam.corp.google.com> 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=-7.3 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 The IOMMU, LSAPIC, IOSAPIC, and PCI host bridge code doesn't care about _PXM values directly; it only needs to know what NUMA node the hardware is on. This uses acpi_get_node() directly and removes the _PXM stuff. Signed-off-by: Bjorn Helgaas --- arch/ia64/hp/common/sba_iommu.c | 22 +++++----------------- arch/ia64/include/asm/pci.h | 2 +- arch/ia64/kernel/acpi.c | 28 +++++++--------------------- arch/ia64/pci/pci.c | 10 ++-------- 4 files changed, 15 insertions(+), 47 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/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index a52d6b49b7ce..007361d59aa6 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -2017,31 +2017,19 @@ sba_connect_bus(struct pci_bus *bus) printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number); } -#ifdef CONFIG_NUMA static void __init sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) { +#ifdef CONFIG_NUMA unsigned int node; - int pxm; - - ioc->node = NUMA_NO_NODE; - - pxm = acpi_get_pxm(handle); - - if (pxm < 0) - return; - node = pxm_to_node(pxm); - - if (node == NUMA_NO_NODE || !node_online(node)) - return; + node = acpi_get_node(handle); + if (node != NUMA_NO_NODE && !node_online(node)) + node = NUMA_NO_NODE; ioc->node = node; - return; -} -#else -#define sba_map_ioc_to_node(ioc, handle) #endif +} static int __init acpi_sba_ioc_add(struct acpi_device *device, diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 71fbaaa495cc..7d41cc089822 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h @@ -98,7 +98,7 @@ struct pci_controller { struct acpi_device *companion; void *iommu; int segment; - int node; /* nearest node with memory or -1 for global allocation */ + int node; /* nearest node with memory or NUMA_NO_NODE for global allocation */ void *platform_data; }; diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 07d209c9507f..5a585ebe9df3 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -803,14 +803,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) * ACPI based hotplug CPU support */ #ifdef CONFIG_ACPI_HOTPLUG_CPU -static -int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) +static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) { #ifdef CONFIG_ACPI_NUMA - int pxm_id; - int nid; - - pxm_id = acpi_get_pxm(handle); /* * We don't have cpu-only-node hotadd. But if the system equips * SRAT table, pxm is already found and node is ready. @@ -818,11 +813,10 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) * This code here is for the system which doesn't have full SRAT * table for possible cpus. */ - nid = acpi_map_pxm_to_node(pxm_id); node_cpuid[cpu].phys_id = physid; - node_cpuid[cpu].nid = nid; + node_cpuid[cpu].nid = acpi_get_node(handle); #endif - return (0); + return 0; } int additional_cpus __initdata = -1; @@ -929,7 +923,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, union acpi_object *obj; struct acpi_madt_io_sapic *iosapic; unsigned int gsi_base; - int pxm, node; + int node; /* Only care about objects w/ a method that returns the MADT */ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) @@ -956,17 +950,9 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, kfree(buffer.pointer); - /* - * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell - * us which node to associate this with. - */ - pxm = acpi_get_pxm(handle); - if (pxm < 0) - return AE_OK; - - node = pxm_to_node(pxm); - - if (node >= MAX_NUMNODES || !node_online(node) || + /* OK, it's an IOSAPIC MADT entry; associate it with a node */ + node = acpi_get_node(handle); + if (node == NUMA_NO_NODE || !node_online(node) || cpumask_empty(cpumask_of_node(node))) return AE_OK; diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 9e4938d8ca4d..291a582777cf 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg) return NULL; controller->segment = seg; - controller->node = -1; return controller; } @@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) struct pci_root_info *info = NULL; int busnum = root->secondary.start; struct pci_bus *pbus; - int pxm, ret; + int ret; controller = alloc_pci_controller(domain); if (!controller) return NULL; controller->companion = device; - - pxm = acpi_get_pxm(device->handle); -#ifdef CONFIG_NUMA - if (pxm >= 0) - controller->node = pxm_to_node(pxm); -#endif + controller->node = acpi_get_node(device->handle); info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) {