Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9077123c authored by Wolfram Sang's avatar Wolfram Sang Committed by Wim Van Sebroeck
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarFabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 248e655b
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -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;
}