Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[powerpc.git] / arch / ia64 / kernel / acpi.c
index 6ea642b..32c3abe 100644 (file)
@@ -32,7 +32,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -56,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: "
 
@@ -618,7 +617,7 @@ EXPORT_SYMBOL(acpi_unregister_gsi);
 static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
 {
        struct acpi_table_header *fadt_header;
-       struct fadt_descriptor_rev2 *fadt;
+       struct fadt_descriptor *fadt;
 
        if (!phys_addr || !size)
                return -EINVAL;
@@ -627,7 +626,7 @@ static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
        if (fadt_header->revision != 3)
                return -ENODEV; /* Only deal with ACPI 2.0 FADT */
 
-       fadt = (struct fadt_descriptor_rev2 *)fadt_header;
+       fadt = (struct fadt_descriptor *)fadt_header;
 
        if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
                acpi_kbd_controller_present = 0;
@@ -772,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);
 }
@@ -857,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;
        }
 
@@ -865,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;
 
@@ -935,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