Skip to content

Commit f7d4cfa

Browse files
cvinayakmbolivar-nordic
authored andcommitted
[nrf fromtree] Bluetooth: Controller: Fix missing aux release on abort of LLL sched
Fix missing auxiliary context release message on abort of LLL scheduling scheduling used by scan context. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 7f24d3b) (cherry picked from commit 343972f)
1 parent efb9ccc commit f7d4cfa

File tree

1 file changed

+29
-14
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/lll

1 file changed

+29
-14
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,19 @@ static void isr_done_cleanup(void *param)
10121012
#if defined(CONFIG_BT_CTLR_ADV_EXT)
10131013
struct event_done_extra *extra;
10141014

1015+
/* Generate Scan done events so that duration and max expiry is
1016+
* detected in ULL.
1017+
*/
1018+
extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN);
1019+
LL_ASSERT(extra);
1020+
1021+
/* Prevent scan events in pipeline from being scheduled if duration has
1022+
* expired.
1023+
*/
1024+
if (unlikely(lll->duration_reload && !lll->duration_expire)) {
1025+
lll->is_stop = 1U;
1026+
}
1027+
10151028
if (lll->is_aux_sched) {
10161029
struct node_rx_pdu *node_rx;
10171030

@@ -1027,19 +1040,6 @@ static void isr_done_cleanup(void *param)
10271040
ull_rx_put(node_rx->hdr.link, node_rx);
10281041
ull_rx_sched();
10291042
}
1030-
1031-
/* Generate Scan done events so that duration and max expiry is
1032-
* detected in ULL.
1033-
*/
1034-
extra = ull_done_extra_type_set(EVENT_DONE_EXTRA_TYPE_SCAN);
1035-
LL_ASSERT(extra);
1036-
1037-
/* Prevent scan events in pipeline from being scheduled if duration has
1038-
* expired.
1039-
*/
1040-
if (unlikely(lll->duration_reload && !lll->duration_expire)) {
1041-
lll->is_stop = 1U;
1042-
}
10431043
#endif /* CONFIG_BT_CTLR_ADV_EXT */
10441044

10451045
lll_isr_cleanup(param);
@@ -1095,9 +1095,24 @@ static void isr_cleanup(void *param)
10951095
#if defined(CONFIG_BT_CTLR_ADV_EXT)
10961096
struct lll_scan *lll = param;
10971097

1098-
lll->is_aux_sched = 0U;
1098+
if (lll->is_aux_sched) {
1099+
struct node_rx_pdu *node_rx;
1100+
1101+
lll->is_aux_sched = 0U;
1102+
1103+
node_rx = ull_pdu_rx_alloc();
1104+
LL_ASSERT(node_rx);
1105+
1106+
node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
1107+
1108+
node_rx->hdr.rx_ftr.param = lll;
1109+
1110+
ull_rx_put(node_rx->hdr.link, node_rx);
1111+
ull_rx_sched();
1112+
}
10991113
#endif /* CONFIG_BT_CTLR_ADV_EXT */
11001114

1115+
11011116
lll_isr_cleanup(param);
11021117
}
11031118

0 commit comments

Comments
 (0)