Skip to content

drivers: serial: nrfx_uarte: fix race condition in uart_rx_disable due to RXTO event #92783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lanwer50
Copy link

@lanwer50 lanwer50 commented Jul 7, 2025

Fixes a race condition where uart_rx_disable() is interrupted by RXTO ISR, which can corrupt internal driver state. The IRQ lock is now taken earlier to ensure atomic access to RX buffer and flags.

Tested on nRF52840 at 460800 baud using Modbus RTU.

Fixes: #92777

@github-actions github-actions bot added area: UART Universal Asynchronous Receiver-Transmitter platform: nRF Nordic nRFx labels Jul 7, 2025
@lanwer50 lanwer50 force-pushed the fix-uarte-rxto-race branch from a8974d4 to 3f02d0d Compare July 7, 2025 15:49
…event

Fixes a race condition where uart_rx_disable() is interrupted by RXTO ISR,
which can corrupt internal driver state. The IRQ lock is now taken earlier
to ensure atomic access to RX buffer and flags.

Tested on nRF52840 at 460800 baud using Modbus RTU.

Fixes: zephyrproject-rtos#92777
Signed-off-by: Anouar Raddaoui <a.raddaoui@smight.com>
@lanwer50 lanwer50 force-pushed the fix-uarte-rxto-race branch from 3f02d0d to 5ea1d25 Compare July 10, 2025 10:31
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race Condition in uarte_nrfx_rx_disable()
5 participants