Skip to content

Bluetooth: Controller: Fix assertion using BT_CTLR_LOW_LAT_ULL_DONE #92715

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

cvinayak
Copy link
Collaborator

@cvinayak cvinayak commented Jul 5, 2025

BT_CTLR_LOW_LAT_ULL_DONE is used to reduce CPU usage in LLL context by delegating the done event dequeue to ULL_HIGH context.

Building a HCI Controller with BT_CTLR_LOW_LAT_ULL_DONE had assertion when used with BlueZ stack.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the placement of the done_inc() call under the CONFIG_BT_CTLR_LOW_LAT_ULL_DONE setting to prevent an assertion by moving it into the ULL_HIGH context.

  • Removed early done_inc() under low-latency macro and added it in the later conditional block
  • Inverted the #if/#else so done_inc() is only called when CONFIG_BT_CTLR_LOW_LAT_ULL_DONE is enabled

Comment on lines 548 to 550
#else /* !CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */
done_inc();
#endif /* !CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */
Copy link
Preview

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on this #else branch is inverted: since this branch corresponds to CONFIG_BT_CTLR_LOW_LAT_ULL_DONE being defined, update the comment to /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */.

Suggested change
#else /* !CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */
done_inc();
#endif /* !CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */
#else /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */
done_inc();
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL_DONE */

Copilot uses AI. Check for mistakes.

Thalley
Thalley previously approved these changes Jul 7, 2025
@cvinayak cvinayak added the bug The issue is a bug, or the PR is fixing a bug label Jul 8, 2025
@cvinayak cvinayak added this to the v4.2.0 milestone Jul 8, 2025
BT_CTLR_LOW_LAT_ULL_DONE is used to reduce CPU usage in LLL
context by delegating the done event dequeue to ULL_HIGH
context.

Building a HCI Controller with BT_CTLR_LOW_LAT_ULL_DONE had
assertion when used with BlueZ stack.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
@cvinayak cvinayak force-pushed the github_low_lat_ull_done_fix branch from 72a2be3 to a60e59b Compare July 8, 2025 07:42
@cvinayak cvinayak requested a review from Thalley July 8, 2025 07:43
@cvinayak
Copy link
Collaborator Author

cvinayak commented Jul 8, 2025

Addressed a minor copilot requested change.

Copy link

sonarqubecloud bot commented Jul 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants