timers/core: Correct callback order during CPU hot plug
[linux-2.6-block.git] / kernel / cpu.c
index f24f45915b54c50b8f0ac84231d370983fd9b9b3..341bf80f80bd685d529db77f6c4afdeda05f28ae 100644 (file)
@@ -1200,11 +1200,6 @@ static struct cpuhp_step cpuhp_bp_states[] = {
                .startup = smpcfd_prepare_cpu,
                .teardown = smpcfd_dead_cpu,
        },
-       [CPUHP_TIMERS_DEAD] = {
-               .name = "timers dead",
-               .startup = NULL,
-               .teardown = timers_dead_cpu,
-       },
        [CPUHP_RCUTREE_PREP] = {
                .name = "RCU-tree prepare",
                .startup = rcutree_prepare_cpu,
@@ -1221,6 +1216,16 @@ static struct cpuhp_step cpuhp_bp_states[] = {
                .skip_onerr             = true,
                .cant_stop              = true,
        },
+       /*
+        * On the tear-down path, timers_dead_cpu() must be invoked
+        * before blk_mq_queue_reinit_notify() from notify_dead(),
+        * otherwise a RCU stall occurs.
+        */
+       [CPUHP_TIMERS_DEAD] = {
+               .name = "timers dead",
+               .startup = NULL,
+               .teardown = timers_dead_cpu,
+       },
        /* Kicks the plugged cpu into life */
        [CPUHP_BRINGUP_CPU] = {
                .name                   = "cpu:bringup",