On Tue, 13 Oct 2026 10:57:47 +0200, Joonho Lee wrote: > > A failed PCM start or a timed-out request can leave virtio-snd messages > owned by the device after the caller returns. Retrying can then reuse > pending messages, and freeing ALSA or control buffers can leave their > addresses in a virtqueue. > > This series fixes enqueue-error recovery and keeps the memory referenced > by outstanding requests alive until completion or device reset. Reset > also detaches unused descriptors before deleting the queues, releasing > their DMA mappings and cancelling PCM messages without reporting them > as completed audio. > > Changes since v2, following the Sashiko AI review: > - Patch 2 protects all stopped-state accesses with vss->lock, including > hw_params, prepare, open, STOP and sync_stop completion. The RELEASE > decision and stopped=true transition now share a critical section. > Sleeping operations remain outside the spinlock. > - Patch 5 aligns every DMA region for both cache maintenance and typed > CPU accesses, and removes the initial +1 offset. This handles coherent > systems where dma_get_cache_alignment() returns 1, as well as odd > region lengths that could otherwise misalign later payloads. > - Patches 1, 3 and 4 are unchanged. > > Validation of the final v3 source: > - ARM64 W=1 module build and ARM32 CONFIG_MMU=n driver object build. > - Source-extracted ASan/UBSan PCM, control, reset, ACK and DMA lifetime > regressions on macOS arm64. The v2 control allocator produces UBSan > misalignment diagnostics; the v3 allocator passes typed header and > request/response integer64 accesses with DMA alignments 1, 2, 4, 8, > 32, 64 and 128. > - Deterministic stopped-state lock instrumentation catches unlocked v2 > accesses and passes 73 lifecycle assertions for v3. It covers ACK > failure, RELEASE failure/retry and ACK during RELEASE, and checks that > blocking operations do not run with the spinlock held. > > The stopped-state test instruments extracted source; it is not KCSAN or > an actual threaded kernel race test. NOMMU was compiled, not booted. > Physical non-coherent DMA hardware and host microphone behavior were > not tested by these regressions. The QEMU ARM64 KASAN fault/recovery runs > reported in v2 have not been rerun for these v3 changes. > > Reproducer source and instructions: > https://github.com/whatisyourname0/virtio-snd-reproducer/tree/3ee5c7c1e864dae50a127b0a25cd122532daa6de > > Based on sound.git for-next commit > 8d70e364e866bdfca81eee24d0688fac9472cfb9. > > AI assistance was used for code changes, tests, review and patch text. > Assisted-by trailers are included. Sashiko's findings were checked against > the driver and covered by regressions before incorporating the fixes. > > Previous series Message-ID: > <[email protected]> > > Joonho Lee (5): > ALSA: virtio: Propagate PCM send failures through ACK > ALSA: virtio: Recover PCM state after a failed start > ALSA: virtio: Retain queued messages through device reset > ALSA: virtio: Keep PCM DMA buffers alive through device ownership > ALSA: virtio: Keep control payloads alive through DMA completion
Through a quick glance, the patches look OK, but they are a bit too heavy changes at this very late stage for the next merge window. I can take those for 7.4-rc1 if the virtio maintainer gives an ack, but otherwise postponed for 7.5. Or, if you have some more urgent fixes to address some known issues, please cook a smaller patch that can be more easily digested. thanks, Takashi

