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

nimble/transport: Fix race in nrf5340 IPC transport #1853

Conversation

andrzej-kaczmarek
Copy link
Contributor

The HCI transport is initialized after LL task is initialized, but the IPC itself is initialized before LL task. If host on appcore starts before HCI transport is initialized on netcore, it can put HCI Reset in IPC shm before we can receive it and handle. This causes host to send 2nd HCI Reset which triggers handling of data in IPC shm and will fail because we cannot handle 2 HCI commands at the same time (i.e. 2x HCI Reset).

This fixes the problem by triggering read from IPC shm just after HCI transport is initialized so we can handle command that was sent there before we were ready to receive it.

The HCI transport is initialized after LL task is initialized, but the
IPC itself is initialized before LL task. If host on appcore starts
before HCI transport is initialized on netcore, it can put HCI Reset in
IPC shm before we can receive it and handle. This causes host to send
2nd HCI Reset which triggers handling of data in IPC shm and will fail
because we cannot handle 2 HCI commands at the same time (i.e. 2x HCI
Reset).

This fixes the problem by triggering read from IPC shm just after HCI
transport is initialized so we can handle command that was sent there
before we were ready to receive it.
@github-actions github-actions bot added the size/XS Extra small PR label Aug 30, 2024
@andrzej-kaczmarek andrzej-kaczmarek merged commit d007e11 into apache:master Sep 2, 2024
18 checks passed
@andrzej-kaczmarek andrzej-kaczmarek deleted the transport-nrf5340-race-fix branch September 2, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Extra small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants