summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2022-08-25 16:32:50 +0800
committerWim Van Sebroeck <wim@linux-watchdog.org>2022-10-02 12:55:44 +0200
commitf182683333b5d8ac4af64517b6e3c444c4579e6e (patch)
tree9e69cb3fe948d050fcf00fd2d7659c1521f54d11 /drivers/watchdog
parenta1f136fd8725243a69681e4e20e29f7b2043ad93 (diff)
downloadlinux-f182683333b5d8ac4af64517b6e3c444c4579e6e.tar.bz2
watchdog: imx7ulp: Move suspend/resume to noirq phase
The i.MX7ULP's watchdog is enabled by default when out of reset, so the resume callback which is to disable watchdog should be called earlier to avoid unexpected timeout, move suspend/resume callback to noirq phase. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com> Tested-by: Peter Chen <peter.chen@nxp.com> Tested-by: Li Jun <jun.li@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220825083256.14565-2-alice.guo@oss.nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/imx7ulp_wdt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c
index 922b60374295..014f497ea0dc 100644
--- a/drivers/watchdog/imx7ulp_wdt.c
+++ b/drivers/watchdog/imx7ulp_wdt.c
@@ -255,7 +255,7 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)
return devm_watchdog_register_device(dev, wdog);
}
-static int __maybe_unused imx7ulp_wdt_suspend(struct device *dev)
+static int __maybe_unused imx7ulp_wdt_suspend_noirq(struct device *dev)
{
struct imx7ulp_wdt_device *imx7ulp_wdt = dev_get_drvdata(dev);
@@ -267,7 +267,7 @@ static int __maybe_unused imx7ulp_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused imx7ulp_wdt_resume(struct device *dev)
+static int __maybe_unused imx7ulp_wdt_resume_noirq(struct device *dev)
{
struct imx7ulp_wdt_device *imx7ulp_wdt = dev_get_drvdata(dev);
u32 timeout = imx7ulp_wdt->wdd.timeout * WDOG_CLOCK_RATE;
@@ -286,8 +286,10 @@ static int __maybe_unused imx7ulp_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(imx7ulp_wdt_pm_ops, imx7ulp_wdt_suspend,
- imx7ulp_wdt_resume);
+static const struct dev_pm_ops imx7ulp_wdt_pm_ops = {
+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx7ulp_wdt_suspend_noirq,
+ imx7ulp_wdt_resume_noirq)
+};
static const struct of_device_id imx7ulp_wdt_dt_ids[] = {
{ .compatible = "fsl,imx7ulp-wdt", },