drivers: serial: uart_xmc4xxx: Fix race condition
Fixes a race condition between uart_xmc4xxx_dma_rx_cb() and rx timeout. Although uart_xmc4xxx_dma_rx_cb() called k_work_cancel_delayable() to cancel the timeout callback, it would not actually be cancelled if the callback was already in a running state. Fix the race condition by checking if dma transaction is already completed in the timeout callback. This also fixes unit test tests/drivers/uart/uart_async_api on xmc45_relax_kit which started to fail after commit f3afd5a4. Signed-off-by:Andriy Gelman <andriy.gelman@gmail.com>
Loading
Please sign in to comment