drivers: serial: uart_sam0: fix |= incorrectly clearing all INTFLAGS.
fix uart_sam0_irq_update to only clear the RXS bit by writing only the RXS bitflag to the INTFLAG register. Performing an |= opperation with the bitflag for RXS incorrectly clears all pending interrupts set since writing 1 to a INTFLAG clears that bit field. This causes a race condition on when TXC will be cleared before all bytes have finished being clocked out on tx and TXC being set 1 again. If tx finishes first, any driver using uart_irq_tx_complete will deadlock the system. Signed-off-by: Ron Smith <rockyowl171@gmail.com>
This commit is contained in:
parent
847b3205d6
commit
863fef4a54
1 changed files with 1 additions and 1 deletions
|
@ -889,7 +889,7 @@ static int uart_sam0_irq_update(const struct device *dev)
|
||||||
| SERCOM_USART_INTENCLR_CTSIC
|
| SERCOM_USART_INTENCLR_CTSIC
|
||||||
| SERCOM_USART_INTENCLR_RXS;
|
| SERCOM_USART_INTENCLR_RXS;
|
||||||
#else
|
#else
|
||||||
regs->INTFLAG.reg |= SERCOM_USART_INTENCLR_RXS;
|
regs->INTFLAG.reg = SERCOM_USART_INTENCLR_RXS;
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue