rp2/machine_uart: Fix potential race condition in interrupt handling.

The irq service routine cleared the RT interrupt bit on TX interrupt.  This
opens the possibility that an RT interrupt is missed.

Signed-off-by: Maarten van der Schrieck <maarten@thingsconnected.nl>
pull/11847/head
Maarten van der Schrieck 2023-06-22 15:52:10 +02:00 zatwierdzone przez Damien George
rodzic c3ca3612d1
commit 057701a770
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -194,7 +194,7 @@ STATIC inline void uart_service_interrupt(machine_uart_obj_t *self) {
}
if (uart_get_hw(self->uart)->mis & UART_UARTMIS_TXMIS_BITS) { // tx interrupt?
// clear all interrupt bits but rx
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & (~UART_UARTICR_RXIC_BITS);
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & ~(UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS);
uart_fill_tx_fifo(self);
}
}