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) { pr_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; /* 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; }
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); struct acpi_device *device; action &= ~CPU_TASKS_FROZEN; switch (action) { case CPU_ONLINE: case CPU_DEAD: break; default: return NOTIFY_DONE; } if (!pr || acpi_bus_get_device(pr->handle, &device)) return NOTIFY_DONE; if (action == CPU_ONLINE) { /* * CPU got physically hotplugged and onlined for the first time: * Initialize missing things. */ if (pr->flags.need_hotplug_init) { int ret; pr_info("Will online and init hotplugged CPU: %d\n", pr->id); pr->flags.need_hotplug_init = 0; ret = __acpi_processor_start(device); WARN(ret, "Failed to start CPU: %d\n", pr->id); } else { /* Normal CPU soft online event. */ acpi_processor_ppc_has_changed(pr, 0); acpi_processor_hotplug(pr); acpi_processor_reevaluate_tstate(pr, action); acpi_processor_tstate_has_changed(pr); } } else if (action == CPU_DEAD) { /* Invalidate flag.throttling after the CPU is offline. */ 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) { 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) { /* invalidate the flag.throttling after one CPU is offline */ acpi_processor_reevaluate_tstate(pr, action); } return NOTIFY_OK; }