@@ -397,7 +397,7 @@ static int scheduler_dp_task_free(void *data, struct task *task)
397397 /* all other memory has been allocated as a single malloc, will be freed later by caller */
398398 return ret ;
399399}
400-
400+ __attribute__(( optimize ( "-O0" )))
401401/* Thread function called in component context, on target core */
402402static void dp_thread_fn (void * p1 , void * p2 , void * p3 )
403403{
@@ -408,7 +408,11 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
408408 unsigned int lock_key ;
409409 enum task_state state ;
410410 bool task_stop ;
411- struct scheduler_dp_data * dp_sch = scheduler_get_data (SOF_SCHEDULE_DP );
411+ struct scheduler_dp_data * dp_sch = NULL ;
412+
413+
414+ if (!(task -> flags & K_USER ))
415+ dp_sch = scheduler_get_data (SOF_SCHEDULE_DP );
412416
413417 do {
414418 /*
@@ -454,7 +458,8 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
454458 * TODO: it should be for all tasks, for all cores
455459 * currently its limited to current core only
456460 */
457- scheduler_dp_recalculate (dp_sch , false);
461+ if (dp_sch )
462+ scheduler_dp_recalculate (dp_sch , false);
458463
459464 scheduler_dp_unlock (lock_key );
460465 } while (!task_stop );
@@ -463,7 +468,7 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
463468 if (task -> state == SOF_TASK_STATE_COMPLETED )
464469 task_complete (task );
465470}
466-
471+ __attribute__(( optimize ( "-O0" )))
467472static int scheduler_dp_task_shedule (void * data , struct task * task , uint64_t start ,
468473 uint64_t period )
469474{
@@ -472,6 +477,9 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta
472477 unsigned int lock_key ;
473478 int ret ;
474479
480+ volatile int i = 0 ;
481+ while (i );
482+
475483 lock_key = scheduler_dp_lock (cpu_get_id ());
476484
477485 if (task -> state != SOF_TASK_STATE_INIT &&
@@ -568,7 +576,7 @@ int scheduler_dp_init(void)
568576
569577 return 0 ;
570578}
571-
579+ __attribute__(( optimize ( "-O0" )))
572580int scheduler_dp_task_init (struct task * * task ,
573581 const struct sof_uuid_entry * uid ,
574582 const struct task_ops * ops ,
0 commit comments