From 122c43562e47bb3674748a55be0c1a6d019f3d31 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 15 May 2020 12:38:20 +0530 Subject: [PATCH] Bluetooth: controller: split: Fix slave latency cancel race Fix missing transmit buffer demutiplexing before checking if slave latency needs to be maintained or cancelled. This bug was detected when new transmit buffer was enqueued overlapping with on-air radio transmission of empty PDU preceding the handling of radio event done. Symptoms of this bug being data transmission latency of upto slave latency plus one times connection interval. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 9185715b10d..6ae6eec3527 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -1058,6 +1058,10 @@ void ull_conn_done(struct node_rx_event_done *done) ull_slave_done(done, &ticks_drift_plus, &ticks_drift_minus); + if (!conn->tx_head) { + ull_conn_tx_demux(UINT8_MAX); + } + if (conn->tx_head || memq_peek(lll->memq_tx.head, lll->memq_tx.tail, NULL)) {