Skip to content

Commit a74ad93

Browse files
committed
audio: chain_dma: do not hold spinlock when calling schedule_task_free
schedule_task_free() might be a blocking call. E.g. the Zephyr LL-scheduler implementation can call k_sem_take(). Do not call this function with a spinlock held. Link: #7156 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 8bc97c1 commit a74ad93

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/audio/chain_dma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,12 @@ static int chain_task_pause(struct comp_dev *dev)
338338
if (!ret)
339339
ret = ret2;
340340

341+
k_spin_unlock(&drivers->lock, key);
342+
341343
schedule_task_cancel(&cd->chain_task);
342344
schedule_task_free(&cd->chain_task);
343345
pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES);
344-
k_spin_unlock(&drivers->lock, key);
346+
345347
return ret;
346348
}
347349

0 commit comments

Comments
 (0)