mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
The request channel must be connected from ALSA .open(), because hw-rule
queries and the stream open request use it. The event channel is
different: XENSND_EVT_CUR_POS handling uses ALSA runtime buffer and
period geometry, and the corresponding Xen stream parameters are not
submitted to the backend until .prepare() sends XENSND_OP_OPEN.
Currently .open() connects both channels. A backend current-position
event, or a stale event queued for an earlier stream instance, can
therefore reach xen_snd_front_alsa_handle_cur_pos() before
runtime->buffer_size and runtime->period_size are valid.
Add a per-channel connection helper, connect only the request channel in
.open(), connect the event channel after a successful stream prepare,
and disconnect it before stream close/free. Re-check the event-channel
state after taking ring_io_lock so disconnecting the event channel
synchronizes against a threaded IRQ that passed the initial lockless
state test. Keep defensive runtime geometry checks in the position
handler.
Fixes:
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| xen_snd_front_alsa.c | ||
| xen_snd_front_alsa.h | ||
| xen_snd_front_cfg.c | ||
| xen_snd_front_cfg.h | ||
| xen_snd_front_evtchnl.c | ||
| xen_snd_front_evtchnl.h | ||
| xen_snd_front.c | ||
| xen_snd_front.h | ||