-
Notifications
You must be signed in to change notification settings - Fork 366
chain dma: fix oops at stream close #11030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
85212b5
39b0f2d
ef18334
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,14 +154,20 @@ static void ipc_thread_unflatten_run(struct processing_module *pmod, struct ipc4 | |
| int scheduler_dp_thread_ipc(struct processing_module *pmod, unsigned int cmd, | ||
| const union scheduler_dp_thread_ipc_param *param) | ||
| { | ||
| struct task_dp_pdata *pdata = pmod->dev->task->priv_data; | ||
| int ret; | ||
|
|
||
| if (!pmod) { | ||
| tr_err(&dp_tr, "no thread module"); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| if (!pmod->dev || !pmod->dev->task || !pmod->dev->task->priv_data) { | ||
| tr_err(&dp_tr, "no thread task or pdata"); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| struct task_dp_pdata *pdata = pmod->dev->task->priv_data; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the path that can lead to any of those pointers being |
||
|
|
||
| if (cmd == SOF_IPC4_MOD_INIT_INSTANCE) { | ||
| /* Wait for the DP thread to start */ | ||
| ret = k_sem_take(&dp_sync[pmod->dev->task->core], DP_THREAD_IPC_TIMEOUT); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,7 +132,7 @@ static void zephyr_ll_task_done(struct zephyr_ll *sch, | |
|
|
||
| task->state = SOF_TASK_STATE_FREE; | ||
|
|
||
| if (pdata->freeing) | ||
| if (pdata && pdata->freeing) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than checking here, could this be fixed at source to ensure the data is valid through the life cycle of zephyr_ll_task_free() ? |
||
| /* | ||
| * zephyr_ll_task_free() is trying to free this task. Complete | ||
| * it and signal the semaphore to let the function proceed | ||
|
|
@@ -297,8 +297,9 @@ static void zephyr_ll_run(void *data) | |
| #ifndef CONFIG_SOF_USERSPACE_LL | ||
| zephyr_ll_lock(sch, &flags); | ||
| #endif | ||
| pdata = task->priv_data; | ||
|
|
||
| if (pdata->freeing || state == SOF_TASK_STATE_COMPLETED) { | ||
| if (!pdata || pdata->freeing || state == SOF_TASK_STATE_COMPLETED) { | ||
| zephyr_ll_task_done(sch, task); | ||
| } else { | ||
| /* | ||
|
|
@@ -457,9 +458,16 @@ static int zephyr_ll_task_free(void *data, struct task *task) | |
| { | ||
| struct zephyr_ll *sch = data; | ||
| uint32_t flags; | ||
| struct zephyr_ll_pdata *pdata = task->priv_data; | ||
| struct zephyr_ll_pdata *pdata; | ||
| bool must_wait, on_list = true; | ||
|
|
||
| if (!task) | ||
| return 0; | ||
|
|
||
| pdata = task->priv_data; | ||
| if (!pdata) | ||
| return 0; | ||
|
|
||
| zephyr_ll_assert_core(sch); | ||
|
|
||
| #ifndef CONFIG_SOF_USERSPACE_LL | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, what is the scenario that can lead to these being
NULL?