Skip to content

Commit d587145

Browse files
committed
Bluetooth: controller: Fix ticker to avoid recursive ticker_job
Fix ticker job to defer itself to avoid recursive invocation to itself due to ticker interface calls from inside the ticker operation callbacks. The recursive use was exposed when using ticker stop operation callback of stopping an auxiliary PDU to stop the primary PDU scheduling as part of generation of Advertising Terminate event. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 48321ef commit d587145

File tree

1 file changed

+8
-1
lines changed
  • subsys/bluetooth/controller/ticker

1 file changed

+8
-1
lines changed

subsys/bluetooth/controller/ticker/ticker.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,11 +2276,18 @@ void ticker_job(void *param)
22762276

22772277
DEBUG_TICKER_JOB(1);
22782278

2279-
/* Defer worker, as job is now running */
2279+
/* Defer job, as worker is running */
22802280
if (instance->worker_trigger) {
22812281
DEBUG_TICKER_JOB(0);
22822282
return;
22832283
}
2284+
2285+
/* Defer job, as job is already running */
2286+
if (instance->job_guard) {
2287+
instance->sched_cb(TICKER_CALL_ID_JOB, TICKER_CALL_ID_JOB, 1,
2288+
instance);
2289+
return;
2290+
}
22842291
instance->job_guard = 1U;
22852292

22862293
/* Back up the previous known tick */

0 commit comments

Comments
 (0)