watchdog: imx_sc_wdt: Don't disable WDT in suspend

[ Upstream commit 2d9d6d300f ]

Parts of the suspend and resume chain is left unprotected if we disable
the WDT here.

>From experiments we can see that the SCU disables and re-enables the WDT
when we enter and leave suspend to ram. By not touching the WDT here we
are protected by the WDT all the way to the SCU.

Signed-off-by: Jonas Blixt <jonas.blixt@actia.se>
CC: Anson Huang <anson.huang@nxp.com>
Fixes: 986857acbc ("watchdog: imx_sc: Add i.MX system controller watchdog support")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240801121845.1465765-1-jonas.blixt@actia.se
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jonas Blixt 2024-08-01 14:18:45 +02:00 committed by Greg Kroah-Hartman
parent 613a8d27d1
commit b972bade15

View File

@ -213,29 +213,6 @@ register_device:
return devm_watchdog_register_device(dev, wdog);
}
static int __maybe_unused imx_sc_wdt_suspend(struct device *dev)
{
struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev);
if (watchdog_active(&imx_sc_wdd->wdd))
imx_sc_wdt_stop(&imx_sc_wdd->wdd);
return 0;
}
static int __maybe_unused imx_sc_wdt_resume(struct device *dev)
{
struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev);
if (watchdog_active(&imx_sc_wdd->wdd))
imx_sc_wdt_start(&imx_sc_wdd->wdd);
return 0;
}
static SIMPLE_DEV_PM_OPS(imx_sc_wdt_pm_ops,
imx_sc_wdt_suspend, imx_sc_wdt_resume);
static const struct of_device_id imx_sc_wdt_dt_ids[] = {
{ .compatible = "fsl,imx-sc-wdt", },
{ /* sentinel */ }
@ -247,7 +224,6 @@ static struct platform_driver imx_sc_wdt_driver = {
.driver = {
.name = "imx-sc-wdt",
.of_match_table = imx_sc_wdt_dt_ids,
.pm = &imx_sc_wdt_pm_ops,
},
};
module_platform_driver(imx_sc_wdt_driver);