casaroli commented on code in PR #22093:
URL: https://github.com/apache/nuttx/pull/22093#discussion_r4665491010


##########
sched/misc/assert.c:
##########
@@ -853,9 +868,18 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb,
 static void reset_board(void)
 {
 #if CONFIG_BOARD_RESET_ON_ASSERT >= 1
-  up_flush_dcache_all();
   board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);

Review Comment:
   With `CONFIG_BOARD_RESET_ON_ASSERT >= 1`, the last dcache flush is now the 
one before `PANIC_KERNEL_FINAL` (line 990). `dump_core_info()` (board crash 
dump, coredump, `syslog_flush()`) and the `SYS_HALT` notifiers run after it, so 
what they write can still be in a write-back dcache when `board_reset()` runs, 
and a warm reset loses it (for example a coredump to a ramlog in 
`RAMLOG_BUFFER_SECTION`, which is kept over a reset). The nested assert at the 
start of `_assert()` now calls `reset_board()` with no flush at all.
   
   Fix: keep `up_flush_dcache_all()` before `board_reset()` here, in addition 
to the new flush before `PANIC_KERNEL_FINAL`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to