Skip to content

Commit 9347470

Browse files
committed
Don't start WDT if it was last reset source
Prevent a case where the board is unbootable due to WDT continuously timing out. May allow recovery from OS depending on the cause. Signed-off-by: Tim Crawford <[email protected]>
1 parent ce670d0 commit 9347470

File tree

1 file changed

+7
-1
lines changed
  • src/board/system76/common

1 file changed

+7
-1
lines changed

src/board/system76/common/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ void main(void) {
106106
gpio_debug();
107107
#endif
108108

109-
wdt_init();
109+
// XXX: Currently, EC upgrade process will trigger a WDT reset after it
110+
// finishes writing the flash.
111+
if (ec_reset_source() == RESET_SOURCE_WDT) {
112+
ERROR("\n<<< WDT reset occurred! >>>\n\n");
113+
} else {
114+
wdt_init();
115+
}
110116

111117
INFO("System76 EC board '%s', version '%s'\n", board(), version());
112118

0 commit comments

Comments
 (0)