Skip to content

Commit

Permalink
MA-23194 Revert "watchdog: imx_sc_wdt: Don't disable WDT in suspend"
Browse files Browse the repository at this point in the history
The SCU does not handle the WDT state, leaving parts of the suspend and
resume process unprotected if the WDT is not explicitly disabled in the
driver. This can cause unwanted system resets during suspend.

By reverting this change, we ensure that the WDT is properly disabled
during suspend and avoid unexpected resets caused by the WDT timing out.

This reverts commit b972bad.

Signed-off-by: Zhipeng Wang <[email protected]>
Change-Id: Ib58f8d42f889978cc2559fba7fc6421e5a076485
  • Loading branch information
zhipeng66 committed Dec 12, 2024
1 parent 550669e commit 7febc6b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/watchdog/imx_sc_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,29 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
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 */ }
Expand All @@ -225,6 +248,7 @@ 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);
Expand Down

0 comments on commit 7febc6b

Please sign in to comment.