watchdog: aspeed: Clear secondary boot flag before restart
Subsystems (2)
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")
Signed-off-by Eddie James <[email protected]>
--- drivers/watchdog/aspeed_wdt.c | 1 + 1 file changed, 1 insertion(+)
drivers/watchdog/aspeed_wdt.c +1 -0
@@ -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
Joel Stanley
maintainerQuoted 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")Signed-off-by Eddie James <[email protected]>
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@@ -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