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 beig 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: Channagoud Kadabi <ckadabi@codeaurora.org>
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 8ac83e5..4c922ae 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -463,6 +463,7 @@
 
 	for (; st->state > target; st->state--) {
 		ret = cpuhp_invoke_callback(cpu, st->state, false, NULL);
+		BUG_ON(ret && st->state < CPUHP_AP_IDLE_DEAD);
 		if (ret) {
 			st->target = prev_state;
 			undo_cpu_down(cpu, st);