rt_data_queue_pop() holds the data queue spinlock while updating the ring state, then calls rt_data_queue_len(). The length function tries to acquire the same non-recursive spinlock again, causing an SMP deadlock when a pop leaves the queue non-empty. Add a private _data_queue_len_nolock() helper for callers which already hold the queue lock. Keep the public rt_data_queue_len() protected by one spinlock acquisition. This does not change the public API, ABI, queue state transitions, low-water mark wakeups, or event callback behavior. Tested on a four-core Spacemit K1 with cyclic HDMI playback and by building the SMP QEMU Virt64 RISC-V BSP with generic audio, Intel HDA and VirtIO Sound. Signed-off-by: GuEe-GUI <2991707448@qq.com> |
||
|---|---|---|
| .. | ||
| utest | ||
| Kconfig | ||
| SConscript | ||
| completion_comm.c | ||
| completion_mp.c | ||
| completion_up.c | ||
| condvar.c | ||
| dataqueue.c | ||
| pipe.c | ||
| ringblk_buf.c | ||
| ringbuffer.c | ||
| waitqueue.c | ||
| workqueue.c | ||