Skip to content

Conversation

@keyonjie
Copy link
Contributor

There could be no more EDF task to be run if the last one in the list is
finished, we don't need to assert in this case.

If the next EDF task gonna be scheduled, interrupt will be generated
again by calling to schedule_edf() in schedule_edf_task(), so it should
be safe to remove the schedule_edf_task_running() in no pending task
scenarios.

Signed-off-by: Keyon Jie yang.jie@linux.intel.com

There could be no more EDF task to be run if the last one in the list is
finished, we don't need to assert in this case.

If the next EDF task gonna be scheduled, interrupt will be generated
again by calling to schedule_edf() in schedule_edf_task(), so it should
be safe to remove the schedule_edf_task_running() in no pending task
scenarios.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
/* having next task is mandatory */
assert(task_next);

schedule_edf_task_running(data, task_next);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds fishy @keyonjie. If the last one in the list is completed, the main audio task would be in WFI isnt it? How will we ever get here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no explanation why the task_next could become NULL as well. But from the scheduler design POV, we should not depends on or make assumption that the main task is always in the list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this bug presented today ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks @keyonjie - I think the correct fix is to make sure we disable all schedulers, timers, IRQs, notifiers prior to shutdown assembly code executing. This should also include cache WB/INV too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, just draft some commits wrt cleanup on secondary cores shutting down here (not tested yet):
#4718

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this should be folded into the power down flow, but I'm curious why the edf scheduler is being run here (if all the task have been removed or the EDF has been shutdown for this core). This could just be a race in the shutdown path and if so we should add this to the comment and explain that no task may be present in this flow.

@keyonjie
Copy link
Contributor Author

The issue is not reproduced anymore with latest main, let's close and reopen if it is needed in future.

@keyonjie
Copy link
Contributor Author

reopen as it might be needed for 2.0 also.

@keyonjie keyonjie reopened this Nov 30, 2021
@lgirdwood
Copy link
Member

@mwasko fyi

@lgirdwood
Copy link
Member

Unrelated RTC process scheduling error on APL.

2021-11-30 12:02:20 UTC [ERROR] Caught kernel log error
===========================>>
[  122.390757] kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rtcwake/2926
[  122.391088] kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rtcwake/2926
[  122.391367] kernel: BUG: using __this_cpu_read() in preemptible [00000000] code: rtcwake/2926
[  122.391676] kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rtcwake/2926
[  122.392032] kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rtcwake/2926
[  122.392360] kernel: BUG: using smp_processor_id() in preemptible [00000000] code: rtcwake/2926
[  122.392674] kernel: BUG: using __this_cpu_read() in preemptible [00000000] code: rtcwake/2926
[  122.393007] kernel: BUG: using __this_cpu_read() in preemptible [00000000] code: rtcwake/2926
[  122.393313] kernel: BUG: using __this_cpu_read() in preemptible [00000000] code: rtcwake/2926
[  122.393613] kernel: BUG: using __this_cpu_read() in preemptible [00000000] code: rtcwake/2926
<<===========================

@lgirdwood lgirdwood merged commit 7aa5886 into thesofproject:main Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants