cpumask/hotplug: Fix cpu_dying() state tracking
authorPeter Zijlstra <peterz@infradead.org>
Tue, 20 Apr 2021 18:04:19 +0000 (20:04 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 21 Apr 2021 11:55:43 +0000 (13:55 +0200)
commit2ea46c6fc9452ac100ad907b051d797225847e33
tree0a9d8f9939f6a0f67aba2390289482b79a0c2301
parent3a7956e25e1d7b3c148569e78895e1f3178122a9
cpumask/hotplug: Fix cpu_dying() state tracking

Vincent reported that for states with a NULL startup/teardown function
we do not call cpuhp_invoke_callback() (because there is none) and as
such we'll not update the cpu_dying() state.

The stale cpu_dying() can eventually lead to triggering BUG().

Rectify this by updating cpu_dying() in the exact same places the
hotplug machinery tracks its directional state, namely
cpuhp_set_state() and cpuhp_reset_state().

Reported-by: Vincent Donnefort <vincent.donnefort@arm.com>
Suggested-by: Vincent Donnefort <vincent.donnefort@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Donnefort <vincent.donnefort@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lkml.kernel.org/r/YH7r+AoQEReSvxBI@hirez.programming.kicks-ass.net
kernel/cpu.c