@@ -409,64 +409,93 @@ static void dp_thread_fn(void *p1, void *p2, void *p3)
409409 enum task_state state ;
410410 bool task_stop ;
411411 struct scheduler_dp_data * dp_sch = NULL ;
412-
412+ volatile int dbg = __LINE__ ;
413+ dbg = __LINE__ ;
413414
414415 if (!(task -> flags & K_USER ))
415416 dp_sch = scheduler_get_data (SOF_SCHEDULE_DP );
417+ dbg = __LINE__ ;
416418
417419 do {
418420 /*
419421 * the thread is started immediately after creation, it will stop on semaphore
420422 * Semaphore will be released once the task is ready to process
421423 */
424+ dbg = __LINE__ ;
422425 k_sem_take (task_pdata -> sem , K_FOREVER );
426+ dbg = __LINE__ ;
423427
424- if (task -> state == SOF_TASK_STATE_RUNNING )
428+ if (task -> state == SOF_TASK_STATE_RUNNING ) {
429+ dbg = __LINE__ ;
425430 state = task_run (task );
426- else
431+ } else {
432+ dbg = __LINE__ ;
427433 state = task -> state ; /* to avoid undefined variable warning */
434+ }
435+ dbg = __LINE__ ;
428436
429437 lock_key = scheduler_dp_lock (task -> core );
438+ dbg = __LINE__ ;
430439 /*
431440 * check if task is still running, may have been canceled by external call
432441 * if not, set the state returned by run procedure
433442 */
434443 if (task -> state == SOF_TASK_STATE_RUNNING ) {
444+ dbg = __LINE__ ;
435445 task -> state = state ;
436446 switch (state ) {
437447 case SOF_TASK_STATE_RESCHEDULE :
448+ dbg = __LINE__ ;
438449 /* mark to reschedule, schedule time is already calculated */
439450 task -> state = SOF_TASK_STATE_QUEUED ;
451+ dbg = __LINE__ ;
440452 break ;
441453
442454 case SOF_TASK_STATE_CANCEL :
455+ dbg = __LINE__ ;
443456 case SOF_TASK_STATE_COMPLETED :
444457 /* remove from scheduling */
458+ dbg = __LINE__ ;
445459 list_item_del (& task -> list );
460+ dbg = __LINE__ ;
446461 break ;
447462
448463 default :
464+ dbg = __LINE__ ;
449465 /* illegal state, serious defect, won't happen */
450466 k_panic ();
451467 }
452468 }
453469
454470 /* if true exit the while loop, terminate the thread */
471+ dbg = __LINE__ ;
455472 task_stop = task -> state == SOF_TASK_STATE_COMPLETED ||
456473 task -> state == SOF_TASK_STATE_CANCEL ;
474+ dbg = __LINE__ ;
457475 /* recalculate all DP tasks readiness and deadlines
458476 * TODO: it should be for all tasks, for all cores
459477 * currently its limited to current core only
460478 */
461- if (dp_sch )
479+ dbg = __LINE__ ;
480+ if (dp_sch ) {
481+ dbg = __LINE__ ;
462482 scheduler_dp_recalculate (dp_sch , false);
483+ }
484+ dbg = __LINE__ ;
463485
464486 scheduler_dp_unlock (lock_key );
487+ dbg = __LINE__ ;
488+
465489 } while (!task_stop );
490+ dbg = __LINE__ ;
466491
467492 /* call task_complete */
468- if (task -> state == SOF_TASK_STATE_COMPLETED )
493+ if (task -> state == SOF_TASK_STATE_COMPLETED ) {
494+ dbg = __LINE__ ;
469495 task_complete (task );
496+ }
497+ dbg = __LINE__ ;
498+
470499}
471500__attribute__((optimize ("-O0" )))
472501static int scheduler_dp_task_shedule (void * data , struct task * task , uint64_t start ,
0 commit comments