cpu/hotplug: Remove skip_onerr field from cpuhp_step structure
When notifiers were there, `skip_onerr` was used to avoid calling particular step startup/teardown callbacks in the CPU up/down rollback path, which made the hotplug asymmetric. As notifiers are gone now after the full state machine conversion, the `skip_onerr` field is no longer required. Remove it from the structure and its usage. Signed-off-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/1535439294-31426-1-git-send-email-mojha@codeaurora.org
This commit is contained in:
parent
5b394b2ddf
commit
6fb86d9720
22
kernel/cpu.c
22
kernel/cpu.c
|
@ -102,8 +102,6 @@ static inline void cpuhp_lock_release(bool bringup) { }
|
||||||
* @name: Name of the step
|
* @name: Name of the step
|
||||||
* @startup: Startup function of the step
|
* @startup: Startup function of the step
|
||||||
* @teardown: Teardown function of the step
|
* @teardown: Teardown function of the step
|
||||||
* @skip_onerr: Do not invoke the functions on error rollback
|
|
||||||
* Will go away once the notifiers are gone
|
|
||||||
* @cant_stop: Bringup/teardown can't be stopped at this step
|
* @cant_stop: Bringup/teardown can't be stopped at this step
|
||||||
*/
|
*/
|
||||||
struct cpuhp_step {
|
struct cpuhp_step {
|
||||||
|
@ -119,7 +117,6 @@ struct cpuhp_step {
|
||||||
struct hlist_node *node);
|
struct hlist_node *node);
|
||||||
} teardown;
|
} teardown;
|
||||||
struct hlist_head list;
|
struct hlist_head list;
|
||||||
bool skip_onerr;
|
|
||||||
bool cant_stop;
|
bool cant_stop;
|
||||||
bool multi_instance;
|
bool multi_instance;
|
||||||
};
|
};
|
||||||
|
@ -550,13 +547,9 @@ static int bringup_cpu(unsigned int cpu)
|
||||||
|
|
||||||
static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
|
static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
|
||||||
{
|
{
|
||||||
for (st->state--; st->state > st->target; st->state--) {
|
for (st->state--; st->state > st->target; st->state--)
|
||||||
struct cpuhp_step *step = cpuhp_get_step(st->state);
|
|
||||||
|
|
||||||
if (!step->skip_onerr)
|
|
||||||
cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL);
|
cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
|
static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
|
||||||
enum cpuhp_state target)
|
enum cpuhp_state target)
|
||||||
|
@ -644,12 +637,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
|
||||||
|
|
||||||
WARN_ON_ONCE(!cpuhp_is_ap_state(state));
|
WARN_ON_ONCE(!cpuhp_is_ap_state(state));
|
||||||
|
|
||||||
if (st->rollback) {
|
|
||||||
struct cpuhp_step *step = cpuhp_get_step(state);
|
|
||||||
if (step->skip_onerr)
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cpuhp_is_atomic_state(state)) {
|
if (cpuhp_is_atomic_state(state)) {
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
st->result = cpuhp_invoke_callback(cpu, state, bringup, st->node, &st->last);
|
st->result = cpuhp_invoke_callback(cpu, state, bringup, st->node, &st->last);
|
||||||
|
@ -673,7 +660,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
|
||||||
st->should_run = false;
|
st->should_run = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
next:
|
|
||||||
cpuhp_lock_release(bringup);
|
cpuhp_lock_release(bringup);
|
||||||
|
|
||||||
if (!st->should_run)
|
if (!st->should_run)
|
||||||
|
@ -916,13 +902,9 @@ void cpuhp_report_idle_dead(void)
|
||||||
|
|
||||||
static void undo_cpu_down(unsigned int cpu, struct cpuhp_cpu_state *st)
|
static void undo_cpu_down(unsigned int cpu, struct cpuhp_cpu_state *st)
|
||||||
{
|
{
|
||||||
for (st->state++; st->state < st->target; st->state++) {
|
for (st->state++; st->state < st->target; st->state++)
|
||||||
struct cpuhp_step *step = cpuhp_get_step(st->state);
|
|
||||||
|
|
||||||
if (!step->skip_onerr)
|
|
||||||
cpuhp_invoke_callback(cpu, st->state, true, NULL, NULL);
|
cpuhp_invoke_callback(cpu, st->state, true, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
|
static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
|
||||||
enum cpuhp_state target)
|
enum cpuhp_state target)
|
||||||
|
|
Loading…
Reference in New Issue