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

[Backport v1.14-branch] Bluetooth: Fix deadlock issues when running low on buffers #17195

Merged
merged 2 commits into from
Jul 2, 2019

Commits on Jul 1, 2019

  1. Bluetooth: Add dedicated pool for HCI_Num_Completed_Packets HCI event

    This event is a priority one, so it's not safe to have it use the RX
    buffer pool which may be depleted due to non-priority events (e.g.
    advertising events). Since the event is consumed synchronously it's
    safe to have a single-buffer pool for it. Also introduce a new
    bt_buf_get_evt() API for HCI drivers to simplify the driver-side code,
    this effectively also deprecates bt_buf_get_cmd_complete() which now
    has no in-tree HCI driver users anymore.
    
    Fixes zephyrproject-rtos#16864
    
    Signed-off-by: Johan Hedberg <[email protected]>
    Johan Hedberg committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    cda7dc8 View commit details
    Browse the repository at this point in the history
  2. Bluetooth: Introduce separate pool for discardable events

    Introduce a separate buffer pool for events which the HCI driver
    considers discardable. Examples of such events could be e.g.
    Advertising Reports. The benefit of having such a pool means that the
    if there is a heavy inflow of such events it will not cause the
    allocation for other critical events to block and may even eliminate
    deadlocks in some cases.
    
    Also update all mesh samples not to specify explicit RX buffer counts
    anymore. Instead, create appropriate defaults in Kconfig so that we
    only need to override this in the app for cases like the bbc:microbit
    with limited memory.
    
    Signed-off-by: Johan Hedberg <[email protected]>
    Johan Hedberg committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    c19eaa9 View commit details
    Browse the repository at this point in the history