-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: Controller: Fix Extended Scanning for slow CPUs #98267
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
base: main
Are you sure you want to change the base?
Bluetooth: Controller: Fix Extended Scanning for slow CPUs #98267
Conversation
|
This pull request introduces a robust handling mechanism for radio ISR latency issues during auxiliary PDU reception setup in the Bluetooth controller. It adds logic to detect and gracefully handle missed hard realtime deadlines, reducing the risk of assertion failures and improving system resilience on slower CPUs. Improvements to radio ISR latency handling:
|
Summary
Possible regression failures and drawbacks
Impact and severity
Notes / suggestions (for consideration)
Overall assessment
|
There was a problem hiding this 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 adds graceful handling for high Radio ISR latencies on slower CPUs (e.g., nRF51x with 16 MHz ARM Cortex-M0) during extended Bluetooth scanning. When the radio setup fails to meet hard real-time deadlines due to CPU limitations, the code now implements a retry mechanism with countdown before asserting, rather than immediately failing.
Key Changes:
- Implements a countdown-based retry mechanism (up to 3 attempts) when radio setup timing fails
- Adds graceful radio event cleanup paths for both auxiliary and non-auxiliary scanning contexts
- Enhances assertion diagnostics with ISR latency information when profiling is enabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const uint8_t latency_skip_max = 3U; | ||
| static uint8_t latency_skip_countdown = latency_skip_max; |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The static variable latency_skip_countdown is not thread-safe. In interrupt contexts or concurrent execution scenarios, multiple invocations could race on this shared state, leading to incorrect countdown behavior. Consider using atomic operations or re-architecting to avoid shared mutable state across ISR invocations.
Add implementation to gracefully handle failure due to high Radio ISR latencies due to higher CPU usage in LLL execution context just before the handling of Radio IRQs. Higher CPU time usage in LLL execution context can be due to slow CPUs, example, nRF51x SoC Series with 16 MHz ARM Cortex-M0 CPU. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
0dbd7c4 to
c37debb
Compare
|
This pull request introduces several improvements and bug fixes to the Bluetooth controller's low-latency features, configuration, and radio event handling. The changes focus on making low-latency options more robust, improving error handling for radio event setup, and cleaning up configuration dependencies. Low-latency features and configuration:
Radio event handling and error resilience:
Low-latency ticker synchronization:
|
ba17b0a to
c3f2124
Compare
|



Add implementation to gracefully handle failure due to high Radio ISR latencies due to higher CPU usage in LLL execution context just before the handling of Radio IRQs. Higher CPU time usage in LLL execution context can be due to slow CPUs, example, nRF51x SoC Series with 16 MHz ARM Cortex-M0 CPU.