diff options
| author | Sergey Senozhatsky <senozhatsky@chromium.org> | 2025-10-07 15:35:40 +0900 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-10-20 20:07:02 +0200 |
| commit | a67818f74512452e9d99a98d990ea9d9b7c91791 (patch) | |
| tree | fb410249880cef3bfd7375ec3e26db674912ac00 | |
| parent | 5a151c2328a78aa0949a393f5c475a64b93a89ca (diff) | |
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>
| -rw-r--r-- | drivers/base/power/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e83503bdc1fd..7a8807ec9a5d 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -34,6 +34,7 @@ #include <linux/cpufreq.h> #include <linux/devfreq.h> #include <linux/timer.h> +#include <linux/nmi.h> #include "../base.h" #include "power.h" @@ -515,6 +516,11 @@ struct dpm_watchdog { #define DECLARE_DPM_WATCHDOG_ON_STACK(wd) \ struct dpm_watchdog wd +static bool __read_mostly dpm_watchdog_all_cpu_backtrace; +module_param(dpm_watchdog_all_cpu_backtrace, bool, 0644); +MODULE_PARM_DESC(dpm_watchdog_all_cpu_backtrace, + "Backtrace all CPUs on DPM watchdog timeout"); + /** * dpm_watchdog_handler - Driver suspend / resume watchdog handler. * @t: The timer that PM watchdog depends on. @@ -530,8 +536,12 @@ static void dpm_watchdog_handler(struct timer_list *t) unsigned int time_left; if (wd->fatal) { + unsigned int this_cpu = smp_processor_id(); + dev_emerg(wd->dev, "**** DPM device timeout ****\n"); show_stack(wd->tsk, NULL, KERN_EMERG); + if (dpm_watchdog_all_cpu_backtrace) + trigger_allbutcpu_cpu_backtrace(this_cpu); panic("%s %s: unrecoverable failure\n", dev_driver_string(wd->dev), dev_name(wd->dev)); } |