Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / ia64 / kernel / acpi.c
index ccdef19..32c3abe 100644 (file)
@@ -55,7 +55,7 @@
 
 #define BAD_MADT_ENTRY(entry, end) (                                        \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length != sizeof(*entry))
+               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
@@ -771,16 +771,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
 {
 #ifdef CONFIG_ACPI_NUMA
        int pxm_id;
+       int nid;
 
        pxm_id = acpi_get_pxm(handle);
-
        /*
-        * Assuming that the container driver would have set the proximity
-        * domain and would have initialized pxm_to_node(pxm_id) && pxm_flag
+        * We don't have cpu-only-node hotadd. But if the system equips
+        * SRAT table, pxm is already found and node is ready.
+        * So, just pxm_to_nid(pxm) is OK.
+        * This code here is for the system which doesn't have full SRAT
+        * table for possible cpus.
         */
-       node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_node(pxm_id);
-
+       nid = acpi_map_pxm_to_node(pxm_id);
        node_cpuid[cpu].phys_id = physid;
+       node_cpuid[cpu].nid = nid;
 #endif
        return (0);
 }
@@ -856,7 +859,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*lsapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
@@ -864,13 +867,13 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
            (!lsapic->flags.enabled)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
        physid = ((lsapic->id << 8) | (lsapic->eid));
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        buffer.length = ACPI_ALLOCATE_BUFFER;
        buffer.pointer = NULL;
 
@@ -934,20 +937,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*iosapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;
 
        if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        gsi_base = iosapic->global_irq_base;
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        /*
         * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell