Skip to content

Commit 979fe80

Browse files
committed
rem scheduler get data
1 parent ee67089 commit 979fe80

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/schedule/zephyr_dp_schedule.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static int scheduler_dp_task_free(void *data, struct task *task)
417417
/* all other memory has been allocated as a single malloc, will be freed later by caller */
418418
return ret;
419419
}
420-
420+
__attribute__((optimize("-O0")))
421421
/* Thread function called in component context, on target core */
422422
static void dp_thread_fn(void *p1, void *p2, void *p3)
423423
{
@@ -428,7 +428,11 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
428428
unsigned int lock_key;
429429
enum task_state state;
430430
bool task_stop;
431-
struct scheduler_dp_data *dp_sch = scheduler_get_data(SOF_SCHEDULE_DP);
431+
struct scheduler_dp_data *dp_sch = NULL;
432+
433+
434+
if (!(task->flags & K_USER))
435+
dp_sch = scheduler_get_data(SOF_SCHEDULE_DP);
432436

433437
do {
434438
/*
@@ -474,7 +478,8 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
474478
* TODO: it should be for all tasks, for all cores
475479
* currently its limited to current core only
476480
*/
477-
scheduler_dp_recalculate(dp_sch, false);
481+
if (dp_sch)
482+
scheduler_dp_recalculate(dp_sch, false);
478483

479484
scheduler_dp_unlock(lock_key);
480485
} while (!task_stop);
@@ -483,7 +488,7 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
483488
if (task->state == SOF_TASK_STATE_COMPLETED)
484489
task_complete(task);
485490
}
486-
491+
__attribute__((optimize("-O0")))
487492
static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t start,
488493
uint64_t period)
489494
{
@@ -492,6 +497,9 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta
492497
unsigned int lock_key;
493498
int ret;
494499

500+
volatile int i = 1;
501+
while (i);
502+
495503
lock_key = scheduler_dp_lock(cpu_get_id());
496504

497505
if (task->state != SOF_TASK_STATE_INIT &&
@@ -588,7 +596,7 @@ int scheduler_dp_init(void)
588596

589597
return 0;
590598
}
591-
599+
__attribute__((optimize("-O0")))
592600
int scheduler_dp_task_init(struct task **task,
593601
const struct sof_uuid_entry *uid,
594602
const struct task_ops *ops,

0 commit comments

Comments
 (0)