Skip to content

Commit ebca71a

Browse files
Dongli ZhangKAGA-KOKO
authored andcommitted
cpu/hotplug: Add debug printks for hotplug callback failures
CPU hotplug callbacks can fail and cause a rollback to the previous state. These failures are silent and therefore hard to debug. Add pr_debug() to the up and down paths which provide information about the error code, the CPU and the failed state. The debug printks can be enabled via kernel command line or sysfs. [ tglx: Adopt to current mainline, massage printk and changelog ] Signed-off-by: Dongli Zhang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Qais Yousef <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1782dc8 commit ebca71a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/cpu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,10 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
692692

693693
ret = cpuhp_invoke_callback_range(true, cpu, st, target);
694694
if (ret) {
695+
pr_debug("CPU UP failed (%d) CPU %u state %s (%d)\n",
696+
ret, cpu, cpuhp_get_step(st->state)->name,
697+
st->state);
698+
695699
cpuhp_reset_state(st, prev_state);
696700
if (can_rollback_cpu(st))
697701
WARN_ON(cpuhp_invoke_callback_range(false, cpu, st,
@@ -1091,6 +1095,9 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st,
10911095

10921096
ret = cpuhp_invoke_callback_range(false, cpu, st, target);
10931097
if (ret) {
1098+
pr_debug("CPU DOWN failed (%d) CPU %u state %s (%d)\n",
1099+
ret, cpu, cpuhp_get_step(st->state)->name,
1100+
st->state);
10941101

10951102
cpuhp_reset_state(st, prev_state);
10961103

0 commit comments

Comments
 (0)