From e31713de273c9727bb5163ed61700a903d9e4604 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 31 May 2023 15:39:46 +0200 Subject: [PATCH] Bluetooth: Controller: ISO: Fix issue with removing peripheral data paths On CIS disconnect, the peripheral will clear all data paths. However ll_remove_iso_path will fail if attempting to remove a data path that has not been setup, so if only the CTLR_TO_HOST direction was set, and the HOST_TO_CTLR bit was set, the function returned an error and never attempted to clear the other direction. Signed-off-by: Emil Gydesen --- subsys/bluetooth/controller/ll_sw/ull_conn_iso.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index 101fe1d0f8f..a28eba5abc3 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -1090,11 +1090,13 @@ static void cis_disabled_cb(void *param) if (IS_PERIPHERAL(cig)) { /* Remove data path and ISOAL sink/source associated with this - * CIS for both directions. + * CIS for both directions. Disable them one at a time to make sure + * both are removed, even if only one is set. */ ll_remove_iso_path(cis->lll.handle, - BIT(BT_HCI_DATAPATH_DIR_CTLR_TO_HOST) | BIT(BT_HCI_DATAPATH_DIR_HOST_TO_CTLR)); + ll_remove_iso_path(cis->lll.handle, + BIT(BT_HCI_DATAPATH_DIR_CTLR_TO_HOST)); ll_conn_iso_stream_release(cis);