diff options
| -rw-r--r-- | kernel/cpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index eb4041f78073..0097acec1c71 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
| @@ -916,7 +916,8 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st, | |||
| 916 | ret = cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL); | 916 | ret = cpuhp_invoke_callback(cpu, st->state, false, NULL, NULL); |
| 917 | if (ret) { | 917 | if (ret) { |
| 918 | st->target = prev_state; | 918 | st->target = prev_state; |
| 919 | undo_cpu_down(cpu, st); | 919 | if (st->state < prev_state) |
| 920 | undo_cpu_down(cpu, st); | ||
| 920 | break; | 921 | break; |
| 921 | } | 922 | } |
| 922 | } | 923 | } |
| @@ -969,7 +970,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, | |||
| 969 | * to do the further cleanups. | 970 | * to do the further cleanups. |
| 970 | */ | 971 | */ |
| 971 | ret = cpuhp_down_callbacks(cpu, st, target); | 972 | ret = cpuhp_down_callbacks(cpu, st, target); |
| 972 | if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) { | 973 | if (ret && st->state == CPUHP_TEARDOWN_CPU && st->state < prev_state) { |
| 973 | cpuhp_reset_state(st, prev_state); | 974 | cpuhp_reset_state(st, prev_state); |
| 974 | __cpuhp_kick_ap(st); | 975 | __cpuhp_kick_ap(st); |
| 975 | } | 976 | } |
