diff options
author | Dongli Zhang <dongli.zhang@oracle.com> | 2021-04-09 07:53:16 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-08-10 18:31:32 +0200 |
commit | ebca71a8c96f0af2ba482489ecc64d88979cd825 (patch) | |
tree | d125a5ac0533fa2a3a70adad3210598a8b1c8c77 /kernel/cpu.c | |
parent | cpu/hotplug: Use DEVICE_ATTR_*() macro (diff) | |
download | linux-ebca71a8c96f0af2ba482489ecc64d88979cd825.tar.xz linux-ebca71a8c96f0af2ba482489ecc64d88979cd825.zip |
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 <dongli.zhang@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Qais Yousef <qais.yousef@arm.com>
Link: https://lore.kernel.org/r/20210409055316.1709-1-dongli.zhang@oracle.com
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 7ef28e1d5ecd..192e43a87407 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -692,6 +692,10 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st, ret = cpuhp_invoke_callback_range(true, cpu, st, target); if (ret) { + pr_debug("CPU UP failed (%d) CPU %u state %s (%d)\n", + ret, cpu, cpuhp_get_step(st->state)->name, + st->state); + cpuhp_reset_state(st, prev_state); if (can_rollback_cpu(st)) 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, ret = cpuhp_invoke_callback_range(false, cpu, st, target); if (ret) { + pr_debug("CPU DOWN failed (%d) CPU %u state %s (%d)\n", + ret, cpu, cpuhp_get_step(st->state)->name, + st->state); cpuhp_reset_state(st, prev_state); |