From patchwork Wed Jan 29 18:18:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3553791 Return-Path: X-Original-To: patchwork-linux-acpi@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 3B640C02DC for ; Wed, 29 Jan 2014 18:23:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55A80201BA for ; Wed, 29 Jan 2014 18:23:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88D3A201B4 for ; Wed, 29 Jan 2014 18:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbaA2SSS (ORCPT ); Wed, 29 Jan 2014 13:18:18 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:51970 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753119AbaA2SSO (ORCPT ); Wed, 29 Jan 2014 13:18:14 -0500 Received: by mail-ie0-f174.google.com with SMTP id tp5so2427198ieb.33 for ; Wed, 29 Jan 2014 10:18:14 -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=GVvldGRIFRXRb+Uu9vDJQvzFwMcwcjAX60VKdvRVC7Q=; b=phFDHl0tFOd2iCDcrLf90t75ILm43fDvgDB3yPogjhUFFLixD+9uIzU8qhtzJVXuw/ va6lX/DexUWJ+6tvOtVMaB+HYleFbZHRTleie8+ATdGcNTGCZ/glh4UC1p0jO6jQTeFV 38ys2uhwPh4cAtkBelHlQAjlpDa+cTlVpnSsG+3aaBw73IJpRsUcjKB0uH240zPuuotO I/ORGs8pDDfjaUTjxe6R8zE+skJFC6tnKbxURW45jfOL2hRapWL/vkG/XzZhoUhTKPJz fbqrBSomvMexgsZ5XMx6spqcNsj9eQD8YjP4IH0tkOMobuB6LdcohtO222d9TRRNNbpP SaZA== 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=GVvldGRIFRXRb+Uu9vDJQvzFwMcwcjAX60VKdvRVC7Q=; b=XfBE2NjtSkK4RVJNkePgxyBOjlmdlO7N8IyDwZK+lLKAqIn8b3513C76GQ7u1rFi20 NvaiNmQLlhVYke320e0yevFTSfMSc8//EF+WNxhBYI6X+8ONBxtFm+9nBk9KfO+2nmqL KnxQg2Z3b8e7ZP2RFq85fbHJOQ4fJ+SocGABONVlw8BFEqYsPJ68WWJp5nZAvXBjRUA1 mWDwo+qslY2UCo7dHcwIjhratUl3ikxhVity5w4NCrlPsCW3ZCrmoDKqwf6fI1LnPyOT wJqBfWQ+RiVm79IquYjqD6fK50DoEtx0bsuDfqCgq1EQ8HmZswPwcH5NBHLkW/Qg0syl COow== X-Gm-Message-State: ALoCoQlT+Epq/TyEWxPviDfDorNzaNOX5C+9xs8hvOWD1Y8ByfX5/AxLnSoF7f0Z+dcu49g2lup2Ma6VX435BLnuHjfuu+jXkx40rkw+M/SPVqZQ9OCejqbgnMl1yf+RUI/GM8oyueu/Zam0POjEftsfdZs2vgSYmur/Kc0Qz6JkFUQpOfPivdZiYbsbxwuR/ppjG8JiopC4LSWMLgN6Id3P1hGykneRqA== X-Received: by 10.50.27.103 with SMTP id s7mr9844083igg.33.1391019494186; Wed, 29 Jan 2014 10:18:14 -0800 (PST) Received: from localhost ([172.29.123.160]) by mx.google.com with ESMTPSA id y7sm10429280igl.8.2014.01.29.10.18.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 10:18:12 -0800 (PST) Subject: [PATCH 06/17] x86/PCI: Add x86_pci_root_bus_node() to look up NUMA node from PCI bus 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:18:11 -0700 Message-ID: <20140129181811.15476.19897.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 AMD early_fill_mp_bus_info() already allocates a struct pci_root_info for each PCI host bridge it finds, and that structure contains the NUMA node number. We don't need to keep the same information in the mp_bus_to_node[] table. This adds x86_pci_root_bus_node(), which returns the NUMA node number, or NUMA_NO_NODE if the node is unknown. Note that unlike get_mp_bus_to_node(), x86_pci_root_bus_node() only works for root buses. For example, if amd_bus.c finds a host bridge on node 1 to [bus 00-0f], get_mp_bus_to_node() returns 1 for any bus between 00 and 0f, but x86_pci_root_bus_node() returns 1 for bus 00 and NUMA_NO_NODE for buses 01-0f. Signed-off-by: Bjorn Helgaas --- arch/x86/include/asm/topology.h | 1 + arch/x86/pci/bus_numa.c | 10 ++++++++++ 2 files changed, 11 insertions(+) -- 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/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index d35f24e231cd..09046a1a6c35 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -131,6 +131,7 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) } struct pci_bus; +int x86_pci_root_bus_node(int bus); void x86_pci_root_bus_resources(int bus, struct list_head *resources); #ifdef CONFIG_SMP diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c index c2735feb2508..2e36a4469549 100644 --- a/arch/x86/pci/bus_numa.c +++ b/arch/x86/pci/bus_numa.c @@ -20,6 +20,16 @@ static struct pci_root_info *x86_find_pci_root_info(int bus) return NULL; } +int x86_pci_root_bus_node(int bus) +{ + struct pci_root_info *info = x86_find_pci_root_info(bus); + + if (!info) + return NUMA_NO_NODE; + + return info->node; +} + void x86_pci_root_bus_resources(int bus, struct list_head *resources) { struct pci_root_info *info = x86_find_pci_root_info(bus);