> From: Joonho Lee <[email protected]> > > Keep the control queue available through snd_card_free() so close-time > STOP and RELEASE commands can still be submitted. Block new control > requests and mark pending messages canceled before reset, then release > their queue references only after reset and queue deletion. > > For PCM queues, detach each remaining virtqueue buffer after the device > has stopped DMA and retire its message without reporting a normal > completion. Detach all queues before deleting them so outstanding DMA > mappings are unmapped and no token remains for a late device completion. > > Protect event callback admission with the event queue lock. Disabling > events waits for an active dispatch, and later callbacks see a closed > gate before ALSA objects are freed. Enable and pending-event draining > share the same lock. > > Reclaim pending event buffers after a failed probe without dispatching > notifications into ALSA objects that have not been constructed. Record > the queue's prior enabled state under its lock before closing admission. > > Track successful virtqueue initialization so teardown and failed restore > cleanup call del_vqs() only for an initialized queue set. > > Fixes: 9d45e514da88 ("ALSA: virtio: handling control messages") > Assisted-by: LLM > Signed-off-by: Joonho Lee <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/20261113-fix-virtio-snd-recovery-final-v33-0-13a934ad5...@gmail.com?part=8
