aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-01-24 17:28:42 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-02-03 12:39:22 -0500
commitb1e9cee7f68620fa2a020e35b5fbe3c4cc780e84 (patch)
treecdedb0185b3602f2a8b8a96e00c4ff43619cbec6
parent10ee3d7032562d6094d3ee7de84af93fcc0250c7 (diff)
ia64: Remove acpi_get_pxm() usage
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 <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--arch/ia64/hp/common/sba_iommu.c22
-rw-r--r--arch/ia64/include/asm/pci.h2
-rw-r--r--arch/ia64/kernel/acpi.c28
-rw-r--r--arch/ia64/pci/pci.c10
4 files changed, 15 insertions, 47 deletions
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)
2017 printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number); 2017 printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number);
2018} 2018}
2019 2019
2020#ifdef CONFIG_NUMA
2021static void __init 2020static void __init
2022sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) 2021sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)
2023{ 2022{
2023#ifdef CONFIG_NUMA
2024 unsigned int node; 2024 unsigned int node;
2025 int pxm;
2026
2027 ioc->node = NUMA_NO_NODE;
2028
2029 pxm = acpi_get_pxm(handle);
2030
2031 if (pxm < 0)
2032 return;
2033 2025
2034 node = pxm_to_node(pxm); 2026 node = acpi_get_node(handle);
2035 2027 if (node != NUMA_NO_NODE && !node_online(node))
2036 if (node == NUMA_NO_NODE || !node_online(node)) 2028 node = NUMA_NO_NODE;
2037 return;
2038 2029
2039 ioc->node = node; 2030 ioc->node = node;
2040 return;
2041}
2042#else
2043#define sba_map_ioc_to_node(ioc, handle)
2044#endif 2031#endif
2032}
2045 2033
2046static int __init 2034static int __init
2047acpi_sba_ioc_add(struct acpi_device *device, 2035acpi_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 {
98 struct acpi_device *companion; 98 struct acpi_device *companion;
99 void *iommu; 99 void *iommu;
100 int segment; 100 int segment;
101 int node; /* nearest node with memory or -1 for global allocation */ 101 int node; /* nearest node with memory or NUMA_NO_NODE for global allocation */
102 102
103 void *platform_data; 103 void *platform_data;
104}; 104};
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)
803 * ACPI based hotplug CPU support 803 * ACPI based hotplug CPU support
804 */ 804 */
805#ifdef CONFIG_ACPI_HOTPLUG_CPU 805#ifdef CONFIG_ACPI_HOTPLUG_CPU
806static 806static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
807int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
808{ 807{
809#ifdef CONFIG_ACPI_NUMA 808#ifdef CONFIG_ACPI_NUMA
810 int pxm_id;
811 int nid;
812
813 pxm_id = acpi_get_pxm(handle);
814 /* 809 /*
815 * We don't have cpu-only-node hotadd. But if the system equips 810 * We don't have cpu-only-node hotadd. But if the system equips
816 * SRAT table, pxm is already found and node is ready. 811 * 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)
818 * This code here is for the system which doesn't have full SRAT 813 * This code here is for the system which doesn't have full SRAT
819 * table for possible cpus. 814 * table for possible cpus.
820 */ 815 */
821 nid = acpi_map_pxm_to_node(pxm_id);
822 node_cpuid[cpu].phys_id = physid; 816 node_cpuid[cpu].phys_id = physid;
823 node_cpuid[cpu].nid = nid; 817 node_cpuid[cpu].nid = acpi_get_node(handle);
824#endif 818#endif
825 return (0); 819 return 0;
826} 820}
827 821
828int additional_cpus __initdata = -1; 822int additional_cpus __initdata = -1;
@@ -929,7 +923,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
929 union acpi_object *obj; 923 union acpi_object *obj;
930 struct acpi_madt_io_sapic *iosapic; 924 struct acpi_madt_io_sapic *iosapic;
931 unsigned int gsi_base; 925 unsigned int gsi_base;
932 int pxm, node; 926 int node;
933 927
934 /* Only care about objects w/ a method that returns the MADT */ 928 /* Only care about objects w/ a method that returns the MADT */
935 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) 929 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,
956 950
957 kfree(buffer.pointer); 951 kfree(buffer.pointer);
958 952
959 /* 953 /* OK, it's an IOSAPIC MADT entry; associate it with a node */
960 * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell 954 node = acpi_get_node(handle);
961 * us which node to associate this with. 955 if (node == NUMA_NO_NODE || !node_online(node) ||
962 */
963 pxm = acpi_get_pxm(handle);
964 if (pxm < 0)
965 return AE_OK;
966
967 node = pxm_to_node(pxm);
968
969 if (node >= MAX_NUMNODES || !node_online(node) ||
970 cpumask_empty(cpumask_of_node(node))) 956 cpumask_empty(cpumask_of_node(node)))
971 return AE_OK; 957 return AE_OK;
972 958
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)
126 return NULL; 126 return NULL;
127 127
128 controller->segment = seg; 128 controller->segment = seg;
129 controller->node = -1;
130 return controller; 129 return controller;
131} 130}
132 131
@@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
430 struct pci_root_info *info = NULL; 429 struct pci_root_info *info = NULL;
431 int busnum = root->secondary.start; 430 int busnum = root->secondary.start;
432 struct pci_bus *pbus; 431 struct pci_bus *pbus;
433 int pxm, ret; 432 int ret;
434 433
435 controller = alloc_pci_controller(domain); 434 controller = alloc_pci_controller(domain);
436 if (!controller) 435 if (!controller)
437 return NULL; 436 return NULL;
438 437
439 controller->companion = device; 438 controller->companion = device;
440 439 controller->node = acpi_get_node(device->handle);
441 pxm = acpi_get_pxm(device->handle);
442#ifdef CONFIG_NUMA
443 if (pxm >= 0)
444 controller->node = pxm_to_node(pxm);
445#endif
446 440
447 info = kzalloc(sizeof(*info), GFP_KERNEL); 441 info = kzalloc(sizeof(*info), GFP_KERNEL);
448 if (!info) { 442 if (!info) {