Skip to content

Commit c2b7a7d

Browse files
duda-patrykCommit Bot
authored andcommitted
uart_buffering: Process UART TX explicitly when disabled interrupt
When interrupts are disabled we should follow the same path like in case when we are in interrupt context. This will fix infinite loop when calling uart_flush_output() (eg. when ASSERT is triggered) with disabled interrupts BUG=b:190597666 BRANCH=none TEST=Trigger ASSERT when interrupts are disabled. Make sure that panic message is shown. Perform this test on following cores: cortex-m - this is the most common core, eg. bloonchipper minute-ia - this is used for Intel Sensor Hub (cros_ish) eg. drallion board riscv-rv32i - hayato (asurada family) has EC chip based on risc-v nds32 - ampton (octopus family) has EC chip based on it Signed-off-by: Patryk Duda <[email protected]> Change-Id: If88881c6444a40a9c6459d8a6ff42f3ad4c4d750 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953234 Commit-Queue: Marcin Wojtas <[email protected]> Tested-by: Patryk Duda <[email protected]> Reviewed-by: Aseda Aboagye <[email protected]>
1 parent bc25754 commit c2b7a7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/uart_buffering.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void uart_flush_output(void)
261261

262262
/* Loop until buffer is empty */
263263
while (tx_buf_head != tx_buf_tail) {
264-
if (in_interrupt_context()) {
264+
if (in_interrupt_context() || !is_interrupt_enabled()) {
265265
/*
266266
* Explicitly process UART output, since the UART
267267
* interrupt may not be able to preempt the interrupt

0 commit comments

Comments
 (0)