summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGovindraj Raja <govindraj.raja@arm.com>2023-05-22 13:22:42 -0500
committerGovindraj Raja <govindraj.raja@arm.com>2023-05-22 13:22:42 -0500
commitae074b369a25747acf98a23389e9d67b39738c71 (patch)
tree7d547539278ea2c36ac63341777a00b63ad1e37e
parentd3e71ead6ea5bc3555ac90a446efec84ef6c6122 (diff)
fix(tsp): flush uart console
tsp uses uart2 and is printing some init messages in main, but in certain situations we may exit tsp and may not have flushed uart data, this could later land in uart fifo overflow or random corruption. Time to time we have seen a character corruption on uart2 arising out of logs from tsp main. So flush console messages from tsp_main before leaving the function. This is inline with our uart usage strategy across TF-A as most entry _main function ensures uart console is flushed before exit. The console flush is harmless and should fix the potential character corruption if it was due to tsp_main negligence. But we cannot also rule out that it could be a potential FVP-UART problem, but that's quite unlikely and further CI daily's will give us a idea if this fixes the character corruption seen or we may need stress test FVP-UART which maybe corrupting character in certain circumstances. Signed-off-by: Govindraj Raja <govindraj.raja@arm.com> Change-Id: I300c6b71c00fa92b8b97b3e77ea936b393d0f7b5
-rw-r--r--bl32/tsp/tsp_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c
index 0878ea4d3..1ab2260ad 100644
--- a/bl32/tsp/tsp_main.c
+++ b/bl32/tsp/tsp_main.c
@@ -50,6 +50,8 @@ uint64_t tsp_main(void)
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count,
tsp_stats[linear_id].cpu_on_count);
+
+ console_flush();
return (uint64_t) &tsp_vector_table;
}