Skip to content

Commit

Permalink
bluetooth: controller: Fixing race re. adv disable in HDC
Browse files Browse the repository at this point in the history
Re. issue "BT LL assert on LL/CON/ADV/BV-04-C #18584"

Signed-off-by: Erik Brockhoff <[email protected]>
  • Loading branch information
erbr-ot authored and carlescufi committed Aug 23, 2019
1 parent 99cca46 commit a4bd5b6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions subsys/bluetooth/controller/ll_sw/ull_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,22 @@ static inline u8_t disable(u16_t handle)
mark = ull_disable_mark(adv);
LL_ASSERT(mark == adv);

#if defined(CONFIG_BT_PERIPHERAL)
if (adv->lll.is_hdcd) {
ret = ticker_stop(TICKER_INSTANCE_ID_CTLR,
TICKER_USER_ID_THREAD, TICKER_ID_ADV_STOP,
ull_ticker_status_give, (void *)&ret_cb);
ret = ull_ticker_status_take(ret, &ret_cb);
if (ret) {
mark = ull_disable_mark(adv);
LL_ASSERT(mark == adv);

return BT_HCI_ERR_CMD_DISALLOWED;
}
ret_cb = TICKER_STATUS_BUSY;
}
#endif

ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_THREAD,
TICKER_ID_ADV_BASE + handle,
ull_ticker_status_give, (void *)&ret_cb);
Expand Down

0 comments on commit a4bd5b6

Please sign in to comment.