Skip to content
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

drivers: serial: nrfx_uarte: Fix race condition in async isr #36464

Merged

Conversation

nordic-krch
Copy link
Contributor

RXTO event is generated always after ENDRX and driver relies
on assumption that ENDRX event is handled before RXTO. However,
when interrupt is preempted after ENDRX check returned false
and RXTO event is already set handling order would be swapped.

Added addtional check to handle RXTO event only if ENDRX is not
set. If ENDRX is set, it means that it is not yet handled. RXTO
event is not cleared and interrupt will be triggered again and
ENDRX event will be handled first.

Signed-off-by: Krzysztof Chruscinski krzysztof.chruscinski@nordicsemi.no

@nordic-krch nordic-krch added bug The issue is a bug, or the PR is fixing a bug area: UART Universal Asynchronous Receiver-Transmitter platform: nRF Nordic nRFx labels Jun 23, 2021
@nordic-krch nordic-krch changed the title jkdrivers: serial: nrfx_uarte: Fix race condition in async isr drivers: serial: nrfx_uarte: Fix race condition in async isr Jun 23, 2021
RXTO event is generated always after ENDRX and driver relies
on assumption that ENDRX event is handled before RXTO. However,
when interrupt is preempted after ENDRX check returned false
and RXTO event is already set handling order would be swapped.

Added addtional check to handle RXTO event only if ENDRX is not
set. If ENDRX is set, it means that it is not yet handled. RXTO
event is not cleared and interrupt will be triggered again and
ENDRX event will be handled first.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
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 bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants