soc: qcom: Handle device hangs during suspend/resume

As cpus can serve ipis and timers during suspend and
resume; msm watchdog would periodically pet hardware,
even when some of suspend/resume callbacks are stuck,
due to software deadlocks. This can cause device hangs,
particularly when noirq callbacks are stuck. To recover
from this, register late suspend (and early resume)
callbacks in msm watchdog; these callbacks would
disable/enable watchdog pet.

Change-Id: Id12251f2bb6565b04a59802a53b6c3cadd017327
Signed-off-by: Neeraj Upadhyay <[email protected]>
Signed-off-by: Prateek Sood <[email protected]>
This commit is contained in:
Neeraj Upadhyay 2020-09-03 09:27:18 +05:30 • committed by Gerrit - the friendly Code Review server
commit 49148c6626
4 changed files with 71 additions and 5 deletions

View file

@ -261,6 +261,13 @@ static int hh_wdt_probe(struct platform_device *pdev)
return qcom_wdt_register(pdev, wdog_dd, "hh-watchdog");
}
static const struct dev_pm_ops hh_wdt_dev_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_late = qcom_wdt_pet_suspend,
.resume_early = qcom_wdt_pet_resume,
#endif
};
static const struct of_device_id hh_wdt_match_table[] = {
{ .compatible = "qcom,hh-watchdog" },
{}
@ -271,6 +278,7 @@ static struct platform_driver hh_wdt_driver = {
.remove = qcom_wdt_remove,
.driver = {
.name = "hh-watchdog",
.pm = &hh_wdt_dev_pm_ops,
.of_match_table = hh_wdt_match_table,
},
};