Skip to content

Bluetooth: Controller: Fix assertion in ull_conn on HCI Reset #93259

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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions subsys/bluetooth/controller/ll_sw/ull_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,8 @@ static void conn_cleanup_finalize(struct ll_conn *conn)
TICKER_ID_CONN_BASE + lll->handle,
ticker_stop_op_cb, conn);
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));
(ticker_status == TICKER_STATUS_BUSY) ||
((void *)conn == ull_disable_mark_get()));

/* Invalidate the connection context */
lll->handle = LLL_HANDLE_INVALID;
Expand Down Expand Up @@ -1982,7 +1983,14 @@ static void ticker_stop_op_cb(uint32_t status, void *param)
static struct mayfly mfy = {0, 0, &link, NULL, conn_disable};
uint32_t ret;

LL_ASSERT(status == TICKER_STATUS_SUCCESS);
/* Peripheral ticker_stop succeeds, or it fails in a race condition
* when disconnecting (race with ticker_stop), say on HCI Reset.
*/
if (status != TICKER_STATUS_SUCCESS) {
LL_ASSERT(param == ull_disable_mark_get());

return;
}

/* Check if any pending LLL events that need to be aborted */
mfy.param = param;
Expand Down