Skip to contentSkip to conversation

power: suspend: Move dpm_watchdog to suspend.c and enhance it

PATCH Superseded [email protected] 1 participant 1 message Nov 18, 2020

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 power: suspend: Move dpm_watchdog to suspend.c and enhance it

Quoted 22 lines
Quoted 4 lines · Greg Kroah-Hartman
Quoted 2 lines · Joseph Jang

Since dpm_watchdog just cover device power management, we proposed to move it to core power suspend.c to cover not only device power

management

Quoted 3 lines
Quoted 3 lines

hang issues, but also core power management hand issues.

Since dpm_watchdog stands for device pm, we propose to use new name

sleep

Quoted 11 lines
Quoted 7 lines

timer and new timeout handler to cover more sleep hang issues. The new timeout handler will dump disk sleep task at first round timeout and trigger kernel panic at second round timeout.
The default timer for each round is defined in CONFIG_PM_SLEEP_TIMER_TIMEOUT.

It still seems odd you can't use a watchdog for this, as you really have just implemented the same thing here, but "open coded" the logic.

Quoted 6 lines
Quoted 2 lines

I'll let Rafael chime in here too, as he knows this area much better than I as to if this is viable or not.

It is viable AFAICS.

Just make the existing thing work with dev == NULL and use it as needed.

Thank you Greg and Rafael code review and good suggestions.

Since dpm_watchdog just covers two functions __device_suspend() and device_resume(). We still don't know how to use current dpm_watchdog to capture other suspend hang cases outside these two functions. So we are trying to enhance it by moving dpm_watchdog from "drivers/base/power/main.c" to "kernel/power/suspend.c" and enable/disable the watchdog in more core pm functions.
Could you help to review if we can do that or not? If not, could you help to give us other better suggestions?

If you agree to do that, I will provide a new PATCH version 4 to fix all coding problems later.

Thank you,
Joseph.