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: 3553911 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 9240D9F382 for ; Wed, 29 Jan 2014 18:24:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2BC3201B9 for ; Wed, 29 Jan 2014 18:24:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFA6A2018E for ; Wed, 29 Jan 2014 18:24:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbaA2SY5 (ORCPT ); Wed, 29 Jan 2014 13:24:57 -0500 Received: from mail-ie0-f172.google.com ([209.85.223.172]:60036 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752153AbaA2SY4 (ORCPT ); Wed, 29 Jan 2014 13:24:56 -0500 Received: by mail-ie0-f172.google.com with SMTP id e14so2473419iej.17 for ; Wed, 29 Jan 2014 10:24:55 -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=YXd/Or2JsF4GCXFPGD5ecxrI0XgU1EwzWkBzp6oefqfDFWbxmLYW3VKWvYcRRgkhmR 53g2lOXOXFFn+WwI/Eh2Pdy2zB6r72cR5FW5kfR+CZSxPibHypLN5dk358O48IdNo/pi /Ly2DWJslVmZmG5jD6+okFFU/SKPLaykF4/yjusvpTLgzyVQ+5+P3RPqnOfZsQKLbiDf 7Dmi/sQevLRutfGhymey5CGCTE3ZjayObaV6HaadgLL69lWtkAWfd9w37/bgqKt3UEfq 9OQLZ8RHmfLpCkkzJXvQe2F4hrPy5qKqKcUFuXiWrXgFQi4NLpucBSR8//QbMgdJF0Pe NUig== X-Gm-Message-State: ALoCoQkooiOPVagnzW1Cg3Uj0ORa2jF1vfIP4k5o4IJpwpfKrxt6TpXhQf9HzzZDz/QS42NcZjPssePSY5IMDlGmdF/7sPuLuipbgXIslQQ2mhNv0y+74Au718dj/7H/PuiGKNia7YyWSuLWUDItkkezpqSG5VON12v9f6n3OC1a6K8dIOUD0K/jmgKD8FQq/oxJQuTfTAN0jO9fVrNxvzRJny4ZtgWt+w== 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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-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/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) {