Skip to content

Commit

Permalink
Bluetooth: controller: split: Move invalidation of connection handle
Browse files Browse the repository at this point in the history
Move invalidation of connection handle when flushing TX buffers into
LLL context. Otherwise, LLL may or may not see invalidated handle
depending on mayfly scheduling.

Signed-off-by: Wolfgang Puffitsch <[email protected]>
  • Loading branch information
wopu-ot authored and aescolar committed Dec 12, 2019
1 parent a2ddf99 commit d3e3f8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/bluetooth/controller/ll_sw/ull_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1714,9 +1714,6 @@ static void conn_cleanup(struct ll_conn *conn, u8_t reason)
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
(ticker_status == TICKER_STATUS_BUSY));

/* Invalidate the connection context */
lll->handle = 0xFFFF;

/* Demux and flush Tx PDUs that remain enqueued in thread context */
ull_conn_tx_demux(UINT8_MAX);
}
Expand Down Expand Up @@ -1746,6 +1743,9 @@ static void tx_lll_flush(void *param)

lll_conn_flush(lll);

/* Invalidate the connection context */
lll->handle = 0xFFFF;

link = memq_dequeue(lll->memq_tx.tail, &lll->memq_tx.head,
(void **)&tx);
while (link) {
Expand Down

0 comments on commit d3e3f8d

Please sign in to comment.