arch: Call board_reset before up_irq_save and spin_trylock

since board_reset may call some kernel functions which try
to acquire the lock again

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-07-27 03:08:14 +08:00
committed by David Sidrane
parent cce7b7ada6
commit 13a7ae3d06
17 changed files with 98 additions and 71 deletions
+4 -3
View File
@@ -73,12 +73,13 @@ static void _up_assert(int errorcode)
if (g_current_regs || running_task()->flink == NULL)
{
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
up_irq_save();
for (; ; )
{
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif
#ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC);
up_mdelay(250);