Skip to content

Commit 09d9747

Browse files
ewoodevsunghan-chang
authored andcommitted
arch: Add warning for unset reboot reason before system reset
Reboot reason is one of the most critical pieces of information for diagnosing why a system rebooted. Without it, post-mortem debugging becomes extremely difficult. So, add validation check for reboot reason before reset and display warning message if reboot reason is not set And, add missing sched_unlock(). it is needed when board_reset is failed. Signed-off-by: eunwoo.nam <eunwoo.nam@samsung.com>
1 parent 3a68fdf commit 09d9747

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

os/arch/boardctl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,18 @@ int boardctl(unsigned int cmd, uintptr_t arg)
152152
/* Add 100ms delay for flushing another logs like printf. */
153153
up_mdelay(100);
154154
lldbg("Board will Reboot now. pid: %d\n", getpid());
155+
#ifdef CONFIG_SYSTEM_REBOOT_REASON
156+
if (!up_reboot_reason_is_written()) {
157+
for (int i = 0; i < 10; i++) {
158+
lldbg("\n VIOLATION!!! YOU MUST SET REBOOT REASON!!!\n\n");
159+
}
160+
}
161+
#endif
155162
/* Add 100ms delay for flushing UART FIFO. */
156163
up_mdelay(100);
157164
ret = board_reset((int)arg);
165+
166+
sched_unlock();
158167
break;
159168
#endif
160169

0 commit comments

Comments
 (0)