From 64faceea7270dd2299c3602b766dcfb935b7fc84 Mon Sep 17 00:00:00 2001 From: Morten Priess Date: Thu, 30 May 2024 15:14:21 +0200 Subject: [PATCH] Bluetooth: controller: Stop Sync ISO ticker when establishment fails When an ISO stream fails to sync to a broadcaster within the first 6 events, the establishment fails (as expected). However, it did not stop the ticker, and subsequently it was impossible to establish a new sync after this. Make asynchronous call to ticker_stop when establishment fails, and exit done handling. Cleanup is handled via ll_rx_dequeue(). Signed-off-by: Morten Priess --- .../bluetooth/controller/ll_sw/ull_sync_iso.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c index 73f8d2159012e9..c549afb9defb00 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_sync_iso.c @@ -731,6 +731,23 @@ void ull_sync_iso_done(struct node_rx_event_done *done) elapsed_event = latency_event + 1U; } + /* Check for establishmet failure */ + if (done->extra.estab_failed) { + uint8_t handle; + uint32_t ret; + + /* Stop Sync ISO Ticker directly. Establishment failure has been + * notified. + */ + handle = sync_iso_handle_get(sync_iso); + ret = ticker_stop(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_ULL_HIGH, + (TICKER_ID_SCAN_SYNC_ISO_BASE + + sync_iso_handle_to_index(handle)), NULL, NULL); + LL_ASSERT((ret == TICKER_STATUS_SUCCESS) || + (ret == TICKER_STATUS_BUSY)); + return; + } + /* Sync drift compensation and new skip calculation */ ticks_drift_plus = 0U;