static int acpi_cpu_soft_notify(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; struct acpi_processor *pr = per_cpu(processors, cpu); if (action == CPU_ONLINE && pr) { if (pr->flags.need_hotplug_init) { struct cpuidle_driver *idle_driver = cpuidle_get_driver(); printk(KERN_INFO "Will online and init hotplugged " "CPU: %d\n", pr->id); WARN(acpi_processor_start(pr), "Failed to start CPU:" " %d\n", pr->id); pr->flags.need_hotplug_init = 0; if (idle_driver && !strcmp(idle_driver->name, "intel_idle")) { intel_idle_cpu_init(pr->id); } } else { acpi_processor_ppc_has_changed(pr, 0); acpi_processor_cst_has_changed(pr); acpi_processor_reevaluate_tstate(pr, action); acpi_processor_tstate_has_changed(pr); } } if (action == CPU_DEAD && pr) { acpi_processor_reevaluate_tstate(pr, action); } return NOTIFY_OK; }
static int acpi_cpu_soft_notify(struct notifier_block *nfb, unsigned long action, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; struct acpi_processor *pr = per_cpu(processors, cpu); if (action == CPU_ONLINE && pr) { /* CPU got physically hotplugged and onlined the first time: * Initialize missing things */ if (pr->flags.need_hotplug_init) { struct cpuidle_driver *idle_driver = cpuidle_get_driver(); printk(KERN_INFO "Will online and init hotplugged " "CPU: %d\n", pr->id); WARN(acpi_processor_start(pr), "Failed to start CPU:" " %d\n", pr->id); pr->flags.need_hotplug_init = 0; if (idle_driver && !strcmp(idle_driver->name, "intel_idle")) { intel_idle_cpu_init(pr->id); } /* Normal CPU soft online event */ } else { acpi_processor_ppc_has_changed(pr, 0); acpi_processor_hotplug(pr); acpi_processor_reevaluate_tstate(pr, action); acpi_processor_tstate_has_changed(pr); } } if (action == CPU_DEAD && pr) { /* invalidate the flag.throttling after one CPU is offline */ acpi_processor_reevaluate_tstate(pr, action); } return NOTIFY_OK; }