Skip to content

Commit 072c8f2

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Fix assertion failed [evdone]
When there are radio events with time reservations lower than the preemption timeout of 1.5 ms, the pipeline has to account for the maximum radio events that can be enqueued during the preempt timeout duration. All these enqueued events could be aborted in case of late scheduling needing as many done event buffers. During continuous scanning, there can be 1 active radio event, 1 scan resume and 1 new scan prepare. If there are peripheral prepares in addition, and due to late scheduling all these will abort needing 4 done buffers. If Extended Scanning is supported, then an additional auxiliary scan event's prepare could be enqueued in the pipeline during the preemption duration. Fixes #36381. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent e763061 commit 072c8f2

File tree

1 file changed

+23
-2
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+23
-2
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,31 @@ static MFIFO_DEFINE(prep, sizeof(struct lll_event), EVENT_PIPELINE_MAX);
305305

306306
/* Declare done-event FIFO: mfifo_done.
307307
* Queue of pointers to struct node_rx_event_done.
308-
* The actual backing behind these pointers is mem_done
308+
* The actual backing behind these pointers is mem_done.
309+
*
310+
* When there are radio events with time reservations lower than the preemption
311+
* timeout of 1.5 ms, the pipeline has to account for the maximum radio events
312+
* that can be enqueued during the preempt timeout duration. All these enqueued
313+
* events could be aborted in case of late scheduling, needing as many done
314+
* event buffers.
315+
*
316+
* During continuous scanning, there can be 1 active radio event, 1 scan resume
317+
* and 1 new scan prepare. If there are peripheral prepares in addition, and due
318+
* to late scheduling all these will abort needing 4 done buffers.
319+
*
320+
* If there are additional peripheral prepares enqueued, which are apart by
321+
* their time reservations, these are not yet late and hence no more additional
322+
* done buffers are needed.
323+
*
324+
* If Extended Scanning is supported, then an additional auxiliary scan event's
325+
* prepare could be enqueued in the pipeline during the preemption duration.
309326
*/
310327
#if !defined(VENDOR_EVENT_DONE_MAX)
311-
#define EVENT_DONE_MAX 3
328+
#if defined(CONFIG_BT_CTLR_ADV_EXT) && defined(CONFIG_BT_OBSERVER)
329+
#define EVENT_DONE_MAX 5
330+
#else /* !CONFIG_BT_CTLR_ADV_EXT || !CONFIG_BT_OBSERVER */
331+
#define EVENT_DONE_MAX 4
332+
#endif /* !CONFIG_BT_CTLR_ADV_EXT || !CONFIG_BT_OBSERVER */
312333
#else
313334
#define EVENT_DONE_MAX VENDOR_EVENT_DONE_MAX
314335
#endif

0 commit comments

Comments
 (0)