Bluetooth: Controller: Revert back early abort of previous prepare

Revert back to implementation that did early abort of
previous prepare when a short prepare is enqueued.

Adds back implementation deleted in
commit 7f388bb70a ("Bluetooth: Controller: Fix short
prepare when many enqueued in pipeline").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2023-10-31 20:17:11 +01:00 committed by Fabio Baltieri
parent b444dc442b
commit d573951f0d
2 changed files with 27 additions and 0 deletions

View file

@ -961,6 +961,13 @@ config BT_CTLR_SCAN_UNRESERVED
Scanner will not use time space reservation for scan window when in
continuous scan mode.
config BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE
bool "Early abort previous prepare"
default y
help
Early abort previous prepare present before a short prepare is
enqueued in the prepare pipeline.
config BT_MAYFLY_YIELD_AFTER_CALL
bool "Yield from mayfly thread after first call"
default y

View file

@ -906,6 +906,26 @@ static uint32_t preempt_ticker_start(struct lll_event *first,
LL_ASSERT((ret == TICKER_STATUS_SUCCESS) ||
(ret == TICKER_STATUS_BUSY));
#if defined(CONFIG_BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE)
/* FIXME: Prepare pipeline is not a ordered list implementation,
* and for short prepare being enqueued, ideally the
* pipeline has to be implemented as ordered list.
* Until then a workaround to abort a prepare present
* before the short prepare being enqueued is implemented
* below.
* A proper solution will be to re-design the pipeline
* as a ordered list, instead of the current FIFO.
*/
/* Set early as we get called again through the call to
* abort_cb().
*/
ticks_at_preempt = ticks_at_preempt_new;
/* Abort previous prepare that set the preempt timeout */
prev->is_aborted = 1U;
prev->abort_cb(&prev->prepare_param, prev->prepare_param.param);
#endif /* CONFIG_BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE */
/* Schedule short preempt timeout */
first = next;
} else {