提交 b1e9cee7 编写于 作者: B Bjorn Helgaas

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: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 10ee3d70
...@@ -2017,31 +2017,19 @@ sba_connect_bus(struct pci_bus *bus) ...@@ -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); 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 static void __init
sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)
{ {
#ifdef CONFIG_NUMA
unsigned int node; unsigned int node;
int pxm;
ioc->node = NUMA_NO_NODE;
pxm = acpi_get_pxm(handle);
if (pxm < 0)
return;
node = pxm_to_node(pxm); node = acpi_get_node(handle);
if (node != NUMA_NO_NODE && !node_online(node))
if (node == NUMA_NO_NODE || !node_online(node)) node = NUMA_NO_NODE;
return;
ioc->node = node; ioc->node = node;
return;
}
#else
#define sba_map_ioc_to_node(ioc, handle)
#endif #endif
}
static int __init static int __init
acpi_sba_ioc_add(struct acpi_device *device, acpi_sba_ioc_add(struct acpi_device *device,
......
...@@ -98,7 +98,7 @@ struct pci_controller { ...@@ -98,7 +98,7 @@ struct pci_controller {
struct acpi_device *companion; struct acpi_device *companion;
void *iommu; void *iommu;
int segment; 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; void *platform_data;
}; };
......
...@@ -803,14 +803,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) ...@@ -803,14 +803,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)
* ACPI based hotplug CPU support * ACPI based hotplug CPU support
*/ */
#ifdef CONFIG_ACPI_HOTPLUG_CPU #ifdef CONFIG_ACPI_HOTPLUG_CPU
static static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
{ {
#ifdef CONFIG_ACPI_NUMA #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 * We don't have cpu-only-node hotadd. But if the system equips
* SRAT table, pxm is already found and node is ready. * 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,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 * This code here is for the system which doesn't have full SRAT
* table for possible cpus. * table for possible cpus.
*/ */
nid = acpi_map_pxm_to_node(pxm_id);
node_cpuid[cpu].phys_id = physid; node_cpuid[cpu].phys_id = physid;
node_cpuid[cpu].nid = nid; node_cpuid[cpu].nid = acpi_get_node(handle);
#endif #endif
return (0); return 0;
} }
int additional_cpus __initdata = -1; int additional_cpus __initdata = -1;
...@@ -929,7 +923,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth, ...@@ -929,7 +923,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
union acpi_object *obj; union acpi_object *obj;
struct acpi_madt_io_sapic *iosapic; struct acpi_madt_io_sapic *iosapic;
unsigned int gsi_base; unsigned int gsi_base;
int pxm, node; int node;
/* Only care about objects w/ a method that returns the MADT */ /* Only care about objects w/ a method that returns the MADT */
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) 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,17 +950,9 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
kfree(buffer.pointer); kfree(buffer.pointer);
/* /* OK, it's an IOSAPIC MADT entry; associate it with a node */
* OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell node = acpi_get_node(handle);
* us which node to associate this with. if (node == NUMA_NO_NODE || !node_online(node) ||
*/
pxm = acpi_get_pxm(handle);
if (pxm < 0)
return AE_OK;
node = pxm_to_node(pxm);
if (node >= MAX_NUMNODES || !node_online(node) ||
cpumask_empty(cpumask_of_node(node))) cpumask_empty(cpumask_of_node(node)))
return AE_OK; return AE_OK;
......
...@@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg) ...@@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg)
return NULL; return NULL;
controller->segment = seg; controller->segment = seg;
controller->node = -1;
return controller; return controller;
} }
...@@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) ...@@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
struct pci_root_info *info = NULL; struct pci_root_info *info = NULL;
int busnum = root->secondary.start; int busnum = root->secondary.start;
struct pci_bus *pbus; struct pci_bus *pbus;
int pxm, ret; int ret;
controller = alloc_pci_controller(domain); controller = alloc_pci_controller(domain);
if (!controller) if (!controller)
return NULL; return NULL;
controller->companion = device; controller->companion = device;
controller->node = acpi_get_node(device->handle);
pxm = acpi_get_pxm(device->handle);
#ifdef CONFIG_NUMA
if (pxm >= 0)
controller->node = pxm_to_node(pxm);
#endif
info = kzalloc(sizeof(*info), GFP_KERNEL); info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) { if (!info) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册