mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
watchdog: renesas_wdt: don't keep timer value during suspend/resume
After discussing this mail thread [1] again, we concluded that giving userspace enough time to prepare is our favourite option. So, do not keep the time value when suspended but reset it when resuming. [1] https://patchwork.kernel.org/patch/10252209/ Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Reviewed-by: Fabrizio Castro <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
parent
248e655b45
commit
9077123c68
1 changed files with 4 additions and 7 deletions
|
|
@ -48,7 +48,6 @@ struct rwdt_priv {
|
|||
void __iomem *base;
|
||||
struct watchdog_device wdev;
|
||||
unsigned long clk_rate;
|
||||
u16 time_left;
|
||||
u8 cks;
|
||||
};
|
||||
|
||||
|
|
@ -268,10 +267,9 @@ static int __maybe_unused rwdt_suspend(struct device *dev)
|
|||
{
|
||||
struct rwdt_priv *priv = dev_get_drvdata(dev);
|
||||
|
||||
if (watchdog_active(&priv->wdev)) {
|
||||
priv->time_left = readw(priv->base + RWTCNT);
|
||||
if (watchdog_active(&priv->wdev))
|
||||
rwdt_stop(&priv->wdev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -279,10 +277,9 @@ static int __maybe_unused rwdt_resume(struct device *dev)
|
|||
{
|
||||
struct rwdt_priv *priv = dev_get_drvdata(dev);
|
||||
|
||||
if (watchdog_active(&priv->wdev)) {
|
||||
if (watchdog_active(&priv->wdev))
|
||||
rwdt_start(&priv->wdev);
|
||||
rwdt_write(priv, priv->time_left, RWTCNT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue