Skip to content

Commit 6fb86d9

Browse files
Mukesh OjhaKAGA-KOKO
authored andcommitted
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
1 parent 5b394b2 commit 6fb86d9

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

kernel/cpu.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ static inline void cpuhp_lock_release(bool bringup) { }
102102
* @name: Name of the step
103103
* @startup: Startup function of the step
104104
* @teardown: Teardown function of the step
105-
* @skip_onerr: Do not invoke the functions on error rollback
106-
* Will go away once the notifiers are gone
107105
* @cant_stop: Bringup/teardown can't be stopped at this step
108106
*/
109107
struct cpuhp_step {
@@ -119,7 +117,6 @@ struct cpuhp_step {
119117
struct hlist_node *node);
120118
} teardown;
121119
struct hlist_head list;
122-
bool skip_onerr;
123120
bool cant_stop;
124121
bool multi_instance;
125122
};
@@ -550,12 +547,8 @@ static int bringup_cpu(unsigned int cpu)
550547

551548
static void undo_cpu_up(unsigned int cpu, struct cpuhp_cpu_state *st)
552549
{
553-
for (st->state--; st->state > st->target; st->state--) {
554-
struct cpuhp_step *step = cpuhp_get_step(st->state);
555-
556-
if (!step->skip_onerr)
557-
cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL);
558-
}
550+
for (st->state--; st->state > st->target; st->state--)
551+
cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL);
559552
}
560553

561554
static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
@@ -644,12 +637,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
644637

645638
WARN_ON_ONCE(!cpuhp_is_ap_state(state));
646639

647-
if (st->rollback) {
648-
struct cpuhp_step *step = cpuhp_get_step(state);
649-
if (step->skip_onerr)
650-
goto next;
651-
}
652-
653640
if (cpuhp_is_atomic_state(state)) {
654641
local_irq_disable();
655642
st->result = cpuhp_invoke_callback(cpu, state, bringup, st->node, &st->last);
@@ -673,7 +660,6 @@ static void cpuhp_thread_fun(unsigned int cpu)
673660
st->should_run = false;
674661
}
675662

676-
next:
677663
cpuhp_lock_release(bringup);
678664

679665
if (!st->should_run)
@@ -916,12 +902,8 @@ void cpuhp_report_idle_dead(void)
916902

917903
static void undo_cpu_down(unsigned int cpu, struct cpuhp_cpu_state *st)
918904
{
919-
for (st->state++; st->state < st->target; st->state++) {
920-
struct cpuhp_step *step = cpuhp_get_step(st->state);
921-
922-
if (!step->skip_onerr)
923-
cpuhp_invoke_callback(cpu, st->state, true, NULL, NULL);
924-
}
905+
for (st->state++; st->state < st->target; st->state++)
906+
cpuhp_invoke_callback(cpu, st->state, true, NULL, NULL);
925907
}
926908

927909
static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,

0 commit comments

Comments
 (0)