Re: [PATCH v6] power: suspend: Move dpm_watchdog to suspend.c and enhance it

From: <hidden>
Date: 2021-03-16 10:13:15
Also in: lkml

Since dpm_watchdog just cover two functions __device_suspend() and
device_resume(), we proposed to move it to core power suspend.c to 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 in
CONFIG_PM_SUSPEND_WATCHDOG_TIMEOUT.
Signed-off-by: Joseph Jang <redacted>
---
Changes since v5:
  - Remove MAINTAINERS update since we current MAINTAINERS already cover  
kernel/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.c
  create mode 100644 kernel/power/suspend_watchdog.h
quoted hunk
@@ -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;
quoted hunk
+
  /**
   * pm_suspend_default_s2idle - Check if suspend-to-idle is the default  
suspend.
   *
@@ -89,6 +92,8 @@ static void s2idle_enter(void)
  {
         trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE,  
true);
quoted hunk
+       stop_suspend_watchdog(&suspend_wd);
+
         raw_spin_lock_irq(&s2idle_lock);
         if (pm_wakeup_pending())
                 goto out;
@@ -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);
  }
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help