Skip to content

Commit 9e0b1d3

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 <tcrawford@system76.com>
1 parent 9de4d3c commit 9e0b1d3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • src/board/system76/common

src/board/system76/common/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ void main(void) {
102102
gpio_debug();
103103
#endif
104104

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

107113
INFO("System76 EC board '%s', version '%s'\n", board(), version());
108114

0 commit comments

Comments
 (0)