Re: [tip:smp/hotplug] cpu/hotplug: Convert to a state machine for the control processor

From: Peter Zijlstra
Date: Wed Mar 02 2016 - 06:23:32 EST


On Tue, Mar 01, 2016 at 11:53:25AM -0800, tip-bot for Thomas Gleixner wrote:
> @@ -558,22 +648,22 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen)
>
> cpuhp_tasks_frozen = tasks_frozen;
>
> + prev_state = st->state;
> + st->target = CPUHP_ONLINE;
> + while (st->state < st->target) {
> + struct cpuhp_step *step;
> +
> + st->state++;
> + step = cpuhp_bp_states + st->state;
> + ret = cpuhp_invoke_callback(cpu, st->state, step->startup);
> + if (ret) {
> + st->target = prev_state;
> + undo_cpu_up(cpu, st);
> + break;
> + }
> + }

All your other state loops use for().