Skip to content

Commit f182683

Browse files
Anson-HuangWim Van Sebroeck
authored andcommitted
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 <[email protected]> Signed-off-by: Alice Guo <[email protected]> Reviewed-by: Jacky Bai <[email protected]> Tested-by: Peter Chen <[email protected]> Tested-by: Li Jun <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent a1f136f commit f182683

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/watchdog/imx7ulp_wdt.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)
255255
return devm_watchdog_register_device(dev, wdog);
256256
}
257257

258-
static int __maybe_unused imx7ulp_wdt_suspend(struct device *dev)
258+
static int __maybe_unused imx7ulp_wdt_suspend_noirq(struct device *dev)
259259
{
260260
struct imx7ulp_wdt_device *imx7ulp_wdt = dev_get_drvdata(dev);
261261

@@ -267,7 +267,7 @@ static int __maybe_unused imx7ulp_wdt_suspend(struct device *dev)
267267
return 0;
268268
}
269269

270-
static int __maybe_unused imx7ulp_wdt_resume(struct device *dev)
270+
static int __maybe_unused imx7ulp_wdt_resume_noirq(struct device *dev)
271271
{
272272
struct imx7ulp_wdt_device *imx7ulp_wdt = dev_get_drvdata(dev);
273273
u32 timeout = imx7ulp_wdt->wdd.timeout * WDOG_CLOCK_RATE;
@@ -286,8 +286,10 @@ static int __maybe_unused imx7ulp_wdt_resume(struct device *dev)
286286
return 0;
287287
}
288288

289-
static SIMPLE_DEV_PM_OPS(imx7ulp_wdt_pm_ops, imx7ulp_wdt_suspend,
290-
imx7ulp_wdt_resume);
289+
static const struct dev_pm_ops imx7ulp_wdt_pm_ops = {
290+
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx7ulp_wdt_suspend_noirq,
291+
imx7ulp_wdt_resume_noirq)
292+
};
291293

292294
static const struct of_device_id imx7ulp_wdt_dt_ids[] = {
293295
{ .compatible = "fsl,imx7ulp-wdt", },

0 commit comments

Comments
 (0)