-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[backport v3.5-branch] Bluetooth: Controller: Few control procedure and compiler re-ordering fixes #74112
Merged
jhedberg
merged 8 commits into
zephyrproject-rtos:v3.5-branch
from
cvinayak:github_v3_5_branch_bt_ctlr_fix
Jul 22, 2024
Merged
[backport v3.5-branch] Bluetooth: Controller: Few control procedure and compiler re-ordering fixes #74112
jhedberg
merged 8 commits into
zephyrproject-rtos:v3.5-branch
from
cvinayak:github_v3_5_branch_bt_ctlr_fix
Jul 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cvinayak
requested review from
thoh-ot,
kruithofa,
erbr-ot,
sjanc and
carlescufi
as code owners
June 12, 2024 03:52
erbr-ot
approved these changes
Jun 12, 2024
@cvinayak do you have a tracking bug for this? big PR for a backport btw, is it all reallly needed? |
In ull_disable, it is imperative that the callback is set up before a second reference counter check, otherwise it may happen that an LLL done event has already passed when the disable callback and semaphore is assigned. This causes the HCI thread to wait until timeout and assert after ull_ticker_stop_with_mark. For certain compilers, due to compiler optimizations, it can be seen from the assembler code that the callback is assigned after the second reference counter check. By adding memory barriers, the code correctly reorders code to the expected sequence. Signed-off-by: Morten Priess <[email protected]> (cherry picked from commit 7f82b6a) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
In case a CPR is intiated but rejected due to CPR active on other connection, rx nodes are leaked due to retained node not being properly released. Signed-off-by: Erik Brockhoff <[email protected]> (cherry picked from commit edef1b7) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Ensure that in LLCP reference to node_rx is cleared when retention is NOT used, to avoid corruption of node_rx later re-allocated Signed-off-by: Erik Brockhoff <[email protected]> (cherry picked from commit 806a4fc) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Only perform retention if not already done. Ensure 'sched' is performed on phy ntf even if dle is not. Signed-off-by: Erik Brockhoff <[email protected]> (cherry picked from commit 9d8059b) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix missing validation of Connection Update Ind PDU. Ignore invalid connection update parameters and force a silent local connection termination. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 4b6d3f1) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Refactor reused function in BT_CTLR_LE_ENC feature. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit fe205a5) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
A Host shall consider any error code that it does not explicitly understand equivalent to the error code Unspecified Error (0x1F). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 78466c8) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add unit tests to cover explicit LLCP error code check and cover the same in the Controller implementation. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit d6f2bc9) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
cvinayak
force-pushed
the
github_v3_5_branch_bt_ctlr_fix
branch
from
July 17, 2024 04:37
4dc4d72
to
59510f9
Compare
fabiobaltieri
approved these changes
Jul 17, 2024
jhedberg
approved these changes
Jul 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add unit tests to cover explicit LLCP error code check and
cover the same in the Controller implementation.
A Host shall consider any error code that it does not
explicitly understand equivalent to the error code
Unspecified Error (0x1F).
Refactor reused function in BT_CTLR_LE_ENC feature.
Fix missing validation of Connection Update Ind PDU. Ignore
invalid connection update parameters and force a silent
local connection termination.
Only perform retention if not already done.
Ensure 'sched' is performed on phy ntf even if dle is not.
Ensure that in LLCP reference to node_rx is cleared when
retention is NOT used, to avoid corruption of node_rx later
re-allocated
In case a CPR is intiated but rejected due to CPR active on
other connection, rx nodes are leaked due to retained node not
being properly released.
In ull_disable, it is imperative that the callback is set up before a
second reference counter check, otherwise it may happen that an LLL done
event has already passed when the disable callback and semaphore is
assigned.
This causes the HCI thread to wait until timeout and assert after
ull_ticker_stop_with_mark.
For certain compilers, due to compiler optimizations, it can be seen
from the assembler code that the callback is assigned after the second
reference counter check.
By adding memory barriers, the code correctly reorders code to the
expected sequence.
Fixes #75981.