Exemplo n.º 1
0
static int acpi_processor_start(struct device *dev)
{
    struct acpi_device *device = ACPI_COMPANION(dev);

    if (!device)
        return -ENODEV;

    return __acpi_processor_start(device);
}
Exemplo n.º 2
0
static int acpi_processor_start(struct device *dev)
{
	struct acpi_device *device;

	if (acpi_bus_get_device(ACPI_HANDLE(dev), &device))
		return -ENODEV;

	return __acpi_processor_start(device);
}
Exemplo n.º 3
0
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;
}