- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / acpi / processor_core.c
index 9ef317f..e9b7b40 100644 (file)
@@ -126,29 +126,6 @@ DEFINE_PER_CPU(struct acpi_processor *, processors);
 EXPORT_PER_CPU_SYMBOL(processors);
 
 struct acpi_processor_errata errata __read_mostly;
-static int set_no_mwait(const struct dmi_system_id *id)
-{
-       printk(KERN_NOTICE PREFIX "%s detected - "
-               "disabling mwait for CPU C-states\n", id->ident);
-       idle_nomwait = 1;
-       return 0;
-}
-
-static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
-       {
-       set_no_mwait, "IFL91 board", {
-       DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
-       DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"),
-       DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"),
-       DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL},
-       {
-       set_no_mwait, "Extensa 5220", {
-       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-       DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
-       DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
-       {},
-};
 
 /* --------------------------------------------------------------------------
                                 Errata Handling
@@ -279,45 +256,6 @@ static int acpi_processor_errata(struct acpi_processor *pr)
 }
 
 /* --------------------------------------------------------------------------
-                              Common ACPI processor functions
-   -------------------------------------------------------------------------- */
-
-/*
- * _PDC is required for a BIOS-OS handshake for most of the newer
- * ACPI processor features.
- */
-static int acpi_processor_set_pdc(struct acpi_processor *pr)
-{
-       struct acpi_object_list *pdc_in = pr->pdc;
-       acpi_status status = AE_OK;
-
-
-       if (!pdc_in)
-               return status;
-       if (idle_nomwait) {
-               /*
-                * If mwait is disabled for CPU C-states, the C2C3_FFH access
-                * mode will be disabled in the parameter of _PDC object.
-                * Of course C1_FFH access mode will also be disabled.
-                */
-               union acpi_object *obj;
-               u32 *buffer = NULL;
-
-               obj = pdc_in->pointer;
-               buffer = (u32 *)(obj->buffer.pointer);
-               buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
-
-       }
-       status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
-
-       if (ACPI_FAILURE(status))
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                   "Could not evaluate _PDC, using legacy perf. control...\n"));
-
-       return status;
-}
-
-/* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
@@ -355,7 +293,7 @@ static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
                           PDE(inode)->data);
 }
 
-static int acpi_processor_add_fs(struct acpi_device *device)
+static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *entry = NULL;
 
@@ -660,8 +598,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
         */
        if (pr->id == -1) {
                if (ACPI_FAILURE
-                   (acpi_processor_hotadd_init(pr->handle, &pr->id)) &&
-                   !processor_cntl_external()) {
+                   (acpi_processor_hotadd_init(pr->handle, &pr->id))) {
                        return -ENODEV;
                }
        }
@@ -674,14 +611,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
         * generated as the following format:
         * CPU+CPU ID.
         */
-       if (pr->id != -1)
-               sprintf(acpi_device_bid(device), "CPU%X", pr->id);
-       else
-               snprintf(acpi_device_bid(device),
-                        ARRAY_SIZE(acpi_device_bid(device)),
-                        "#%0*X",
-                        (int)ARRAY_SIZE(acpi_device_bid(device)) - 2,
-                        pr->acpi_id);
+       sprintf(acpi_device_bid(device), "CPU%X", pr->id);
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
                          pr->acpi_id));
 
@@ -713,17 +643,13 @@ static int acpi_processor_get_info(struct acpi_device *device)
         * of /proc/cpuinfo
         */
        status = acpi_evaluate_object(pr->handle, "_SUN", NULL, &buffer);
-       if (ACPI_SUCCESS(status) && pr->id != -1)
+       if (ACPI_SUCCESS(status))
                arch_fix_phys_package_id(pr->id, object.integer.value);
 
        return 0;
 }
 
-#ifndef CONFIG_XEN
 static DEFINE_PER_CPU(void *, processor_device_array);
-#else
-static void *processor_device_array[NR_ACPI_CPUS];
-#endif
 
 static void acpi_processor_notify(struct acpi_device *device, u32 event)
 {
@@ -736,7 +662,7 @@ static void acpi_processor_notify(struct acpi_device *device, u32 event)
        switch (event) {
        case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
                saved = pr->performance_platform_limit;
-               acpi_processor_ppc_has_changed(pr);
+               acpi_processor_ppc_has_changed(pr, 1);
                if (saved == pr->performance_platform_limit)
                        break;
                acpi_bus_generate_proc_event(device, event,
@@ -772,7 +698,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
        struct acpi_processor *pr = per_cpu(processors, cpu);
 
        if (action == CPU_ONLINE && pr) {
-               acpi_processor_ppc_has_changed(pr);
+               acpi_processor_ppc_has_changed(pr, 0);
                acpi_processor_cst_has_changed(pr);
                acpi_processor_tstate_has_changed(pr);
        }
@@ -804,84 +730,52 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
        strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
        device->driver_data = pr;
 
-       processor_extcntl_init();
-
        result = acpi_processor_get_info(device);
-       if (result ||
-           ((pr->id == -1) && !processor_cntl_external())) {
+       if (result) {
                /* Processor is physically not present */
                return 0;
        }
 
-       BUG_ON(!processor_cntl_external() &&
-              ((pr->id >= nr_cpu_ids) || (pr->id < 0)));
+       BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 
        /*
         * Buggy BIOS check
         * ACPI id of processors can be reported wrongly by the BIOS.
         * Don't trust it blindly
         */
-#ifndef CONFIG_XEN
        if (per_cpu(processor_device_array, pr->id) != NULL &&
            per_cpu(processor_device_array, pr->id) != device) {
-#else
-       BUG_ON(pr->acpi_id >= NR_ACPI_CPUS);
-       if (processor_device_array[pr->acpi_id] != NULL &&
-           processor_device_array[pr->acpi_id] != device) {
-#endif
                printk(KERN_WARNING "BIOS reported wrong ACPI id "
                        "for the processor\n");
                result = -ENODEV;
                goto err_free_cpumask;
        }
-#ifndef CONFIG_XEN
        per_cpu(processor_device_array, pr->id) = device;
 
        per_cpu(processors, pr->id) = pr;
-#else
-       processor_device_array[pr->acpi_id] = device;
-       if (pr->id != -1)
-               per_cpu(processors, pr->id) = pr;
-#endif
 
        result = acpi_processor_add_fs(device);
        if (result)
                goto err_free_cpumask;
 
-       if (pr->id != -1) {
-               sysdev = get_cpu_sysdev(pr->id);
-               if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
-                       result = -EFAULT;
-                       goto err_remove_fs;
-               }
+       sysdev = get_cpu_sysdev(pr->id);
+       if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
+               result = -EFAULT;
+               goto err_remove_fs;
        }
 
        /* _PDC call should be done before doing anything else (if reqd.). */
-       arch_acpi_processor_init_pdc(pr);
-       acpi_processor_set_pdc(pr);
-       arch_acpi_processor_cleanup_pdc(pr);
+       acpi_processor_set_pdc(pr->handle);
 
-#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL)
-       acpi_processor_ppc_has_changed(pr);
+#ifdef CONFIG_CPU_FREQ
+       acpi_processor_ppc_has_changed(pr, 0);
 #endif
+       acpi_processor_get_throttling_info(pr);
+       acpi_processor_get_limit_info(pr);
 
-       /*
-        * pr->id may equal to -1 while processor_cntl_external enabled.
-        * throttle and thermal module don't support this case.
-        * Tx only works when dom0 vcpu == pcpu num by far, as we give
-        * control to dom0.
-        */
-       if (pr->id != -1) {
-               acpi_processor_get_throttling_info(pr);
-               acpi_processor_get_limit_info(pr);
-       }
 
        acpi_processor_power_init(pr, device);
 
-       result = processor_extcntl_prepare(pr);
-       if (result)
-               goto err_power_exit;
-
        pr->cdev = thermal_cooling_device_register("Processor", device,
                                                &processor_cooling_ops);
        if (IS_ERR(pr->cdev)) {
@@ -889,7 +783,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
                goto err_power_exit;
        }
 
-       dev_info(&device->dev, "registered as cooling_device%d\n",
+       dev_dbg(&device->dev, "registered as cooling_device%d\n",
                 pr->cdev->id);
 
        result = sysfs_create_link(&device->dev.kobj,
@@ -933,7 +827,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
 
        pr = acpi_driver_data(device);
 
-       if (!processor_cntl_external() && pr->id >= nr_cpu_ids)
+       if (pr->id >= nr_cpu_ids)
                goto free;
 
        if (type == ACPI_BUS_REMOVAL_EJECT) {
@@ -943,8 +837,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
 
        acpi_processor_power_exit(pr, device);
 
-       if (pr->id != -1)
-               sysfs_remove_link(&device->dev.kobj, "sysdev");
+       sysfs_remove_link(&device->dev.kobj, "sysdev");
 
        acpi_processor_remove_fs(device);
 
@@ -955,14 +848,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
                pr->cdev = NULL;
        }
 
-#ifndef CONFIG_XEN
        per_cpu(processors, pr->id) = NULL;
        per_cpu(processor_device_array, pr->id) = NULL;
-#else
-       if (pr->id != -1)
-               per_cpu(processors, pr->id) = NULL;
-       processor_device_array[pr->acpi_id] = NULL;
-#endif
 
 free:
        free_cpumask_var(pr->throttling.shared_cpu_map);
@@ -1018,10 +905,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
                return -ENODEV;
        }
 
-       if (processor_cntl_external() && acpi_driver_data(*device))
-               processor_notify_external(acpi_driver_data(*device),
-                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
-
        return 0;
 }
 
@@ -1051,10 +934,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
                                            "Unable to add the device\n");
                        break;
                }
-               pr = acpi_driver_data(device);
-               if (processor_cntl_external() && pr)
-                       processor_notify_external(pr,
-                                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -1071,9 +950,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
                                    "Driver data is NULL, dropping EJECT\n");
                        return;
                }
-               if (processor_cntl_external())
-                       processor_notify_external(pr, PROCESSOR_HOTPLUG,
-                                               HOTPLUG_TYPE_REMOVE);
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -1138,11 +1014,6 @@ static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu)
 
 static int acpi_processor_handle_eject(struct acpi_processor *pr)
 {
-#ifdef CONFIG_XEN
-       if (pr->id == -1)
-               return (0);
-#endif
-
        if (cpu_online(pr->id))
                cpu_down(pr->id);
 
@@ -1169,7 +1040,7 @@ void acpi_processor_install_hotplug_notify(void)
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
-                           processor_walk_namespace_cb, &action, NULL);
+                           processor_walk_namespace_cb, NULL, &action, NULL);
 #endif
        register_hotcpu_notifier(&acpi_cpu_notifier);
 }
@@ -1182,7 +1053,7 @@ void acpi_processor_uninstall_hotplug_notify(void)
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
-                           processor_walk_namespace_cb, &action, NULL);
+                           processor_walk_namespace_cb, NULL, &action, NULL);
 #endif
        unregister_hotcpu_notifier(&acpi_cpu_notifier);
 }
@@ -1212,11 +1083,6 @@ static int __init acpi_processor_init(void)
        if (!acpi_processor_dir)
                return -ENOMEM;
 #endif
-       /*
-        * Check whether the system is DMI table. If yes, OSPM
-        * should not use mwait for CPU-states.
-        */
-       dmi_check_system(processor_idle_dmi_table);
        result = cpuidle_register_driver(&acpi_idle_driver);
        if (result < 0)
                goto out_proc;