x86/PCI: Add x86_pci_root_bus_node() to look up NUMA node from PCI bus
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Jan 2014 18:54:36 +0000 (11:54 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 3 Feb 2014 17:38:35 +0000 (10:38 -0700)
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 <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/x86/include/asm/topology.h
arch/x86/pci/bus_numa.c

index d35f24e231cd2429c8d17c0d5b3d722951d3e04b..09046a1a6c35b7fb0de1768aefd48d1b0fd80e53 100644 (file)
@@ -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
index c2735feb2508148ec16efab887ec1aab2dcc0aec..2e36a4469549cd7ddc0ff6080c444cc70e47ee9b 100644 (file)
@@ -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);
This page took 0.029999 seconds and 5 git commands to generate.