提交 dff700fa 编写于 作者: U Uwe Kleine-König 提交者: Alexandre Belloni

rtc: stmp3xxx: Don't reset the rtc in .probe() when watchdog is running

As pointed out in the added comment resetting the rtc also stops the
included watchdog. This is bad if the bootloader started the watchdog to
secure the boot process. So don't reset if the watchdog is running.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
上级 d6c3029f
...@@ -288,10 +288,22 @@ static int stmp3xxx_rtc_probe(struct platform_device *pdev) ...@@ -288,10 +288,22 @@ static int stmp3xxx_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rtc_data); platform_set_drvdata(pdev, rtc_data);
err = stmp_reset_block(rtc_data->io); /*
if (err) { * Resetting the rtc stops the watchdog timer that is potentially
dev_err(&pdev->dev, "stmp_reset_block failed: %d\n", err); * running. So (assuming it is running on purpose) don't reset if the
return err; * watchdog is enabled.
*/
if (readl(rtc_data->io + STMP3XXX_RTC_CTRL) &
STMP3XXX_RTC_CTRL_WATCHDOGEN) {
dev_info(&pdev->dev,
"Watchdog is running, skip resetting rtc\n");
} else {
err = stmp_reset_block(rtc_data->io);
if (err) {
dev_err(&pdev->dev, "stmp_reset_block failed: %d\n",
err);
return err;
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册