aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2005-03-25 00:58:00 -0500
committerTony Luck <tony.luck@intel.com>2005-05-03 16:33:18 -0400
commitbb0fc085457cf6a865b8232b0cefab3a7819df44 (patch)
treedeaa9e3b58d6e40cb2bdba61898bf8373dc02688 /arch
parentc0b12422e5e1d041026dd27074de17d2d7e32c4e (diff)
[IA64] use common pxm function
This patch simplifies a couple places where we search for _PXM values in ACPI namespace. Thanks, Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/hp/common/sba_iommu.c34
-rw-r--r--arch/ia64/kernel/acpi.c23
2 files changed, 9 insertions, 48 deletions
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 6a8fcba7a853..b8db6e3e5e81 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1944,43 +1944,17 @@ sba_connect_bus(struct pci_bus *bus)
1944static void __init 1944static void __init
1945sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) 1945sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)
1946{ 1946{
1947 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
1948 union acpi_object *obj;
1949 acpi_handle phandle;
1950 unsigned int node; 1947 unsigned int node;
1948 int pxm;
1951 1949
1952 ioc->node = MAX_NUMNODES; 1950 ioc->node = MAX_NUMNODES;
1953 1951
1954 /* 1952 pxm = acpi_get_pxm(handle);
1955 * Check for a _PXM on this node first. We don't typically see
1956 * one here, so we'll end up getting it from the parent.
1957 */
1958 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PXM", NULL, &buffer))) {
1959 if (ACPI_FAILURE(acpi_get_parent(handle, &phandle)))
1960 return;
1961
1962 /* Reset the acpi buffer */
1963 buffer.length = ACPI_ALLOCATE_BUFFER;
1964 buffer.pointer = NULL;
1965
1966 if (ACPI_FAILURE(acpi_evaluate_object(phandle, "_PXM", NULL,
1967 &buffer)))
1968 return;
1969 }
1970 1953
1971 if (!buffer.length || !buffer.pointer) 1954 if (pxm < 0)
1972 return; 1955 return;
1973 1956
1974 obj = buffer.pointer; 1957 node = pxm_to_nid_map[pxm];
1975
1976 if (obj->type != ACPI_TYPE_INTEGER ||
1977 obj->integer.value >= MAX_PXM_DOMAINS) {
1978 acpi_os_free(buffer.pointer);
1979 return;
1980 }
1981
1982 node = pxm_to_nid_map[obj->integer.value];
1983 acpi_os_free(buffer.pointer);
1984 1958
1985 if (node >= MAX_NUMNODES || !node_online(node)) 1959 if (node >= MAX_NUMNODES || !node_online(node))
1986 return; 1960 return;
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index a8e99c56a768..72dfd9e7de0f 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -779,7 +779,7 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
779 union acpi_object *obj; 779 union acpi_object *obj;
780 struct acpi_table_iosapic *iosapic; 780 struct acpi_table_iosapic *iosapic;
781 unsigned int gsi_base; 781 unsigned int gsi_base;
782 int node; 782 int pxm, node;
783 783
784 /* Only care about objects w/ a method that returns the MADT */ 784 /* Only care about objects w/ a method that returns the MADT */
785 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) 785 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 gsi_base = iosapic->global_irq_base; 805 gsi_base = iosapic->global_irq_base;
806 806
807 acpi_os_free(buffer.pointer); 807 acpi_os_free(buffer.pointer);
808 buffer.length = ACPI_ALLOCATE_BUFFER;
809 buffer.pointer = NULL;
810 808
811 /* 809 /*
812 * OK, it's an IOSAPIC MADT entry, look for a _PXM method to tell 810 * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell
813 * us which node to associate this with. 811 * us which node to associate this with.
814 */ 812 */
815 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PXM", NULL, &buffer))) 813 pxm = acpi_get_pxm(handle);
816 return AE_OK; 814 if (pxm < 0)
817
818 if (!buffer.length || !buffer.pointer)
819 return AE_OK;
820
821 obj = buffer.pointer;
822
823 if (obj->type != ACPI_TYPE_INTEGER ||
824 obj->integer.value >= MAX_PXM_DOMAINS) {
825 acpi_os_free(buffer.pointer);
826 return AE_OK; 815 return AE_OK;
827 }
828 816
829 node = pxm_to_nid_map[obj->integer.value]; 817 node = pxm_to_nid_map[pxm];
830 acpi_os_free(buffer.pointer);
831 818
832 if (node >= MAX_NUMNODES || !node_online(node) || 819 if (node >= MAX_NUMNODES || !node_online(node) ||
833 cpus_empty(node_to_cpumask(node))) 820 cpus_empty(node_to_cpumask(node)))