Bluetooth: controller: split: Fix to stop preempt ticker

Fixed premature abort of events due to stale preempt ticker
expiry.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-04-23 15:13:26 +05:30 committed by Carles Cufí
commit e51167b787

View file

@ -59,6 +59,7 @@ static int resume_enqueue(lll_prepare_cb_t resume_cb, int resume_prio);
static void isr_race(void *param); static void isr_race(void *param);
#if !defined(CONFIG_BT_CTLR_LOW_LAT) #if !defined(CONFIG_BT_CTLR_LOW_LAT)
static void ticker_stop_op_cb(uint32_t status, void *param);
static void ticker_start_op_cb(uint32_t status, void *param); static void ticker_start_op_cb(uint32_t status, void *param);
static void preempt_ticker_start(struct lll_prepare_param *prepare_param); static void preempt_ticker_start(struct lll_prepare_param *prepare_param);
static void preempt_ticker_cb(uint32_t ticks_at_expire, uint32_t remainder, static void preempt_ticker_cb(uint32_t ticks_at_expire, uint32_t remainder,
@ -558,9 +559,18 @@ static int prepare(lll_is_abort_cb_t is_abort_cb, lll_abort_cb_t abort_cb,
err = prepare_cb(prepare_param); err = prepare_cb(prepare_param);
/* NOTE: Should the preempt timeout be stopped, check for any more #if !defined(CONFIG_BT_CTLR_LOW_LAT)
* in pipeline? uint32_t ret;
*/
/* Stop any scheduled preempt ticker */
ret = ticker_stop(TICKER_INSTANCE_ID_CTLR,
TICKER_USER_ID_LLL,
TICKER_ID_LLL_PREEMPT,
ticker_stop_op_cb, NULL);
LL_ASSERT((ret == TICKER_STATUS_SUCCESS) ||
(ret == TICKER_STATUS_FAILURE) ||
(ret == TICKER_STATUS_BUSY));
#endif /* !CONFIG_BT_CTLR_LOW_LAT */
return err; return err;
} }
@ -583,6 +593,17 @@ static void isr_race(void *param)
} }
#if !defined(CONFIG_BT_CTLR_LOW_LAT) #if !defined(CONFIG_BT_CTLR_LOW_LAT)
static void ticker_stop_op_cb(uint32_t status, void *param)
{
/* NOTE: this callback is present only for addition of debug messages
* when needed, else can be dispensed with.
*/
ARG_UNUSED(param);
LL_ASSERT((status == TICKER_STATUS_SUCCESS) ||
(status == TICKER_STATUS_FAILURE));
}
static void ticker_start_op_cb(uint32_t status, void *param) static void ticker_start_op_cb(uint32_t status, void *param)
{ {
/* NOTE: this callback is present only for addition of debug messages /* NOTE: this callback is present only for addition of debug messages