Commit bb0fc085 authored by Alex Williamson's avatar Alex Williamson Committed by Tony Luck

[IA64] use common pxm function

This patch simplifies a couple places where we search for _PXM
values in ACPI namespace.  Thanks,
Signed-off-by: default avatarAlex Williamson <alex.williamson@hp.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent c0b12422
...@@ -1944,43 +1944,17 @@ sba_connect_bus(struct pci_bus *bus) ...@@ -1944,43 +1944,17 @@ sba_connect_bus(struct pci_bus *bus)
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)
{ {
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *obj;
acpi_handle phandle;
unsigned int node; unsigned int node;
int pxm;
ioc->node = MAX_NUMNODES; ioc->node = MAX_NUMNODES;
/* pxm = acpi_get_pxm(handle);
* Check for a _PXM on this node first. We don't typically see
* one here, so we'll end up getting it from the parent.
*/
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PXM", NULL, &buffer))) {
if (ACPI_FAILURE(acpi_get_parent(handle, &phandle)))
return;
/* Reset the acpi buffer */
buffer.length = ACPI_ALLOCATE_BUFFER;
buffer.pointer = NULL;
if (ACPI_FAILURE(acpi_evaluate_object(phandle, "_PXM", NULL,
&buffer)))
return;
}
if (!buffer.length || !buffer.pointer) if (pxm < 0)
return; return;
obj = buffer.pointer; node = pxm_to_nid_map[pxm];
if (obj->type != ACPI_TYPE_INTEGER ||
obj->integer.value >= MAX_PXM_DOMAINS) {
acpi_os_free(buffer.pointer);
return;
}
node = pxm_to_nid_map[obj->integer.value];
acpi_os_free(buffer.pointer);
if (node >= MAX_NUMNODES || !node_online(node)) if (node >= MAX_NUMNODES || !node_online(node))
return; return;
......
...@@ -779,7 +779,7 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) ...@@ -779,7 +779,7 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
union acpi_object *obj; union acpi_object *obj;
struct acpi_table_iosapic *iosapic; struct acpi_table_iosapic *iosapic;
unsigned int gsi_base; unsigned int gsi_base;
int node; int pxm, 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)))
...@@ -805,29 +805,16 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) ...@@ -805,29 +805,16 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
gsi_base = iosapic->global_irq_base; gsi_base = iosapic->global_irq_base;
acpi_os_free(buffer.pointer); acpi_os_free(buffer.pointer);
buffer.length = ACPI_ALLOCATE_BUFFER;
buffer.pointer = NULL;
/* /*
* OK, it's an IOSAPIC MADT entry, look for a _PXM method to tell * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell
* us which node to associate this with. * us which node to associate this with.
*/ */
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PXM", NULL, &buffer))) pxm = acpi_get_pxm(handle);
return AE_OK; if (pxm < 0)
if (!buffer.length || !buffer.pointer)
return AE_OK;
obj = buffer.pointer;
if (obj->type != ACPI_TYPE_INTEGER ||
obj->integer.value >= MAX_PXM_DOMAINS) {
acpi_os_free(buffer.pointer);
return AE_OK; return AE_OK;
}
node = pxm_to_nid_map[obj->integer.value]; node = pxm_to_nid_map[pxm];
acpi_os_free(buffer.pointer);
if (node >= MAX_NUMNODES || !node_online(node) || if (node >= MAX_NUMNODES || !node_online(node) ||
cpus_empty(node_to_cpumask(node))) cpus_empty(node_to_cpumask(node)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment