Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0864c12 authored by Channagoud Kadabi's avatar Channagoud Kadabi Committed by Rishabh Bhatnagar
Browse files

kernel: cpu: Handle hotplug failure for state CPUHP_AP_IDLE_DEAD



Once the tear down hotplug handler is run cpu is dead and enters
into CPUHP_AP_IDLE_DEAD state. Any callbacks that fail in the state
machine with state < CPUHP_AP_IDLE must be treated as fatal. As this
could result into timer not being migrated away from dead cpu and run
into issues like work queue lock ups, sched_clock timer wrapping to
zero as sched_clock_pll which is in the hrtimer base of cpu being
hotplugged does not get migrated.

Change-Id: I214c329f5a342d676cc26f57dba453d4a2cbe1a6
Signed-off-by: default avatarChannagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: default avatarRishabh Bhatnagar <rishabhb@codeaurora.org>
parent be37633b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -837,6 +837,7 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,

	for (; st->state > target; st->state--) {
		ret = cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL);
		BUG_ON(ret && st->state < CPUHP_AP_IDLE_DEAD);
		if (ret) {
			st->target = prev_state;
			undo_cpu_down(cpu, st);