hda: chain dma: cancel task before freeing it

When schedule_task_free() is called to a scheduled zephyr_ll task it
sometimes causes a crash. Canceling the task before freeing appears to
fix the problem.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
This commit is contained in:
Jyri Sarha 2023-02-17 23:28:56 +02:00 committed by Liam Girdwood
parent 4d67d2f416
commit 60e9e97e0d
1 changed files with 1 additions and 0 deletions

View File

@ -338,6 +338,7 @@ static int chain_task_pause(struct comp_dev *dev)
if (!ret) if (!ret)
ret = ret2; ret = ret2;
schedule_task_cancel(&cd->chain_task);
schedule_task_free(&cd->chain_task); schedule_task_free(&cd->chain_task);
pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES);
k_spin_unlock(&drivers->lock, key); k_spin_unlock(&drivers->lock, key);