power: suspend: Move dpm_watchdog to suspend.c and enhance it
Quoted 57 lines
Since
dpm_watchdogjust cover two functions__device_suspend()anddevice_resume(), we proposed to move it to core powersuspend.cto extend its coverage and monitor more devices suspend hand issues.We propose to use new name suspend watchdog and new timeout handler to cover more sleep hang issues. The new timeout handler will dump disk sleep task call trace at first round timeout and trigger kernel panic at second round timeout.
The default timer for each round is defined inCONFIG_PM_SUSPEND_WATCHDOG_TIMEOUT.Signed-off-by Joseph Jang <[email protected]>---
Changes since v5:
- RemoveMAINTAINERSupdate since we currentMAINTAINERSalready coverkernel/power/drivers/base/power/main.c | 69 --------------------------- kernel/power/Kconfig | 27 +++++------ kernel/power/Makefile | 1 + kernel/power/suspend.c | 19 ++++++++ kernel/power/suspend_watchdog.c | 84 +++++++++++++++++++++++++++++++++ kernel/power/suspend_watchdog.h | 40 ++++++++++++++++ kernel/printk/printk.c | 2 +- 7 files changed, 158 insertions(+), 84 deletions(-)create mode 100644
kernel/power/suspend_watchdog.ccreate mode 100644kernel/power/suspend_watchdog.h(quoted diff) +1
-0@@ -916,7 +852,6 @@ static int device_resume(struct device *dev, pm_message_t state, bool async) if (!dpm_wait_for_superior(dev, async)) goto Complete; + /** * pm_suspend_default_s2idle - Check if suspend-to-idle is the defaultsuspend.
*(quoted diff) +2
-0@@ -89,6 +92,8 @@ static void s2idle_enter(void) { trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true); + stop_suspend_watchdog(&suspend_wd); + raw_spin_lock_irq(&s2idle_lock); if (pm_wakeup_pending())goto out;(quoted diff) +2
-0@@ -114,6 +119,8 @@ static void s2idle_enter(void) s2idle_state = S2IDLE_STATE_NONE; raw_spin_unlock_irq(&s2idle_lock); + start_suspend_watchdog(&suspend_wd); + trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false); }
Quoted 1 line
2.30.0.365.g02bc693789-goog
Hi Greg and Rafael,
Sorry for the interrupt ~
Since this patch is really help us to narrow down many problems at our platform. May I know if you could help to take a look at PATCH#6 again ?
Thank you,
Joseph.