Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PM: dpm_watchdog: add module param to backtrace all CPUs

Add dpm_watchdog_all_cpu_backtrace module parameter which
controls all CPU backtrace dump before the DPM watchdog panics
the system.

This is expected to help understand what might have caused device
timeout.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Link: https://patch.msgid.link/20251007063551.3147937-1-senozhatsky@chromium.org
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Sergey Senozhatsky and committed by
Rafael J. Wysocki
a67818f7 5a151c23

+10
+10
drivers/base/power/main.c
··· 34 34 #include <linux/cpufreq.h> 35 35 #include <linux/devfreq.h> 36 36 #include <linux/timer.h> 37 + #include <linux/nmi.h> 37 38 38 39 #include "../base.h" 39 40 #include "power.h" ··· 516 515 #define DECLARE_DPM_WATCHDOG_ON_STACK(wd) \ 517 516 struct dpm_watchdog wd 518 517 518 + static bool __read_mostly dpm_watchdog_all_cpu_backtrace; 519 + module_param(dpm_watchdog_all_cpu_backtrace, bool, 0644); 520 + MODULE_PARM_DESC(dpm_watchdog_all_cpu_backtrace, 521 + "Backtrace all CPUs on DPM watchdog timeout"); 522 + 519 523 /** 520 524 * dpm_watchdog_handler - Driver suspend / resume watchdog handler. 521 525 * @t: The timer that PM watchdog depends on. ··· 536 530 unsigned int time_left; 537 531 538 532 if (wd->fatal) { 533 + unsigned int this_cpu = smp_processor_id(); 534 + 539 535 dev_emerg(wd->dev, "**** DPM device timeout ****\n"); 540 536 show_stack(wd->tsk, NULL, KERN_EMERG); 537 + if (dpm_watchdog_all_cpu_backtrace) 538 + trigger_allbutcpu_cpu_backtrace(this_cpu); 541 539 panic("%s %s: unrecoverable failure\n", 542 540 dev_driver_string(wd->dev), dev_name(wd->dev)); 543 541 }