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

Conversation

jhedberg
Copy link
Member

@jhedberg jhedberg commented Jul 1, 2019

Backport #17137

Johan Hedberg added 2 commits July 1, 2019 16:38
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]>
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]>
@jhedberg jhedberg added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth labels Jul 1, 2019
@zephyrbot zephyrbot added area: API Changes to public APIs area: Samples Samples area: Tests Issues related to a particular existing or missing test labels Jul 1, 2019
Copy link
Contributor

@Vudentz Vudentz left a comment

Choose a reason for hiding this comment

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

LGTM

@nashif nashif merged commit 8c2c561 into zephyrproject-rtos:v1.14-branch Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Bluetooth area: Samples Samples area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants