Skip to content

Commit 2ed412a

Browse files
dp: change notifier "LL post run" to "pre run"
For DP a deadline time starts at the beginning of LL cycle, so it needs to be calculated there. As DP is the only users of NOTIFIER_ID_LL_POST_RUN I's changed it to NOTIFIER_ID_LL_PRE_RUN instead of introducing another hook Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent 68b51b4 commit 2ed412a

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/include/sof/lib/notifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum notify_id {
3131
NOTIFIER_ID_BUFFER_CONSUME, /* struct buffer_cb_transact* */
3232
NOTIFIER_ID_BUFFER_FREE, /* struct buffer_cb_free* */
3333
NOTIFIER_ID_DMA_COPY, /* struct dma_cb_data* */
34-
NOTIFIER_ID_LL_POST_RUN, /* NULL */
34+
NOTIFIER_ID_LL_PRE_RUN, /* NULL */
3535
NOTIFIER_ID_DMA_IRQ, /* struct dma_chan_data * */
3636
NOTIFIER_ID_DAI_TRIGGER, /* struct dai_group * */
3737
NOTIFIER_ID_MIC_PRIVACY_STATE_CHANGE, /* struct mic_privacy_settings * */

src/schedule/ll_schedule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ static void schedule_ll_tasks_run(void *data)
313313

314314
perf_cnt_init(&sch->pcd);
315315

316+
notifier_event(sch, NOTIFIER_ID_LL_PRE_RUN,
317+
NOTIFIER_TARGET_CORE_LOCAL, NULL, 0);
318+
316319
/* run tasks if there are any pending */
317320
if (schedule_ll_is_pending(sch))
318321
schedule_ll_tasks_execute(sch);
319322

320-
notifier_event(sch, NOTIFIER_ID_LL_POST_RUN,
321-
NOTIFIER_TARGET_CORE_LOCAL, NULL, 0);
322-
323323
perf_cnt_stamp(&sch->pcd, perf_ll_sched_trace, 0 /* ignored */);
324324
perf_cnt_average(&sch->pcd, perf_avg_ll_sched_trace, 0 /* ignored */);
325325

src/schedule/zephyr_dp_schedule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ int scheduler_dp_init(void)
464464
if (ret)
465465
return ret;
466466

467-
notifier_register(NULL, NULL, NOTIFIER_ID_LL_POST_RUN, scheduler_dp_ll_tick, 0);
467+
notifier_register(NULL, NULL, NOTIFIER_ID_LL_PRE_RUN, scheduler_dp_ll_tick, 0);
468468

469469
return 0;
470470
}

src/schedule/zephyr_ll.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ static void zephyr_ll_run(void *data)
176176
struct list_item *list, *tmp, task_head = LIST_INIT(task_head);
177177
uint32_t flags;
178178

179+
notifier_event(sch, NOTIFIER_ID_LL_PRE_RUN,
180+
NOTIFIER_TARGET_CORE_LOCAL, NULL, 0);
181+
179182
zephyr_ll_lock(sch, &flags);
180183

181184
/*
@@ -185,7 +188,6 @@ static void zephyr_ll_run(void *data)
185188
* always consistent and contains the tasks, that we haven't run in this
186189
* cycle yet.
187190
*/
188-
189191
for (list = sch->tasks.next; !list_is_empty(&sch->tasks); list = sch->tasks.next) {
190192
enum task_state state;
191193
struct zephyr_ll_pdata *pdata;
@@ -247,9 +249,6 @@ static void zephyr_ll_run(void *data)
247249
}
248250

249251
zephyr_ll_unlock(sch, &flags);
250-
251-
notifier_event(sch, NOTIFIER_ID_LL_POST_RUN,
252-
NOTIFIER_TARGET_CORE_LOCAL, NULL, 0);
253252
}
254253

255254
static void schedule_ll_callback(void *data)

0 commit comments

Comments
 (0)