Skip to contentSkip to conversation

watchdog: aspeed: Clear secondary boot flag before restart

PATCH In review Eddie James 2 participants 2 messages Mar 15, 2018 – Mar 19, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: aspeed: Clear secondary boot flag before restart

If a watchdog device is configured to boot from the secondary boot source upon timeout, and that watchdog is used as the restart device, then the system will switch chips on every reboot. This is not desired. Clear the secondary boot bit from the watchdog control register before restarting the system.

Fixes 30e055280e3a ("watchdog: aspeed: Allow configuring for alternate boot")
---
 drivers/watchdog/aspeed_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/aspeed_wdt.c +1 -0
index f41d246..a5b8eb2 100644
@@ -159,6 +159,7 @@ static int aspeed_wdt_restart(struct watchdog_device *wdd,
 {
 	struct aspeed_wdt *wdt = to_aspeed_wdt(wdd);
 
+	wdt->ctrl &= ~WDT_CTRL_BOOT_SECONDARY;
 	aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000);
 
 	mdelay(1000);
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 8 lines · Eddie James

If a watchdog device is configured to boot from the secondary boot source upon timeout, and that watchdog is used as the restart device, then the system will switch chips on every reboot. This is not desired. Clear the secondary boot bit from the watchdog control register before restarting the system.

Fixes 30e055280e3a ("watchdog: aspeed: Allow configuring for alternate boot")

Thanks, I merged in the upstream commit.

Cheers,

Joel

Quoted 19 lines
---
 drivers/watchdog/aspeed_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/aspeed_wdt.c +1 -1
index f41d246..a5b8eb2 100644
@@ -159,6 +159,7 @@ static int aspeed_wdt_restart(struct watchdog_device *wdd,
 {
        struct aspeed_wdt *wdt = to_aspeed_wdt(wdd);
 
+       wdt->ctrl &= ~WDT_CTRL_BOOT_SECONDARY;
        aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000);
 
        mdelay(1000);
--

1.8.3.1