[PATCH v17 00/12] ALSA: virtio: fix capture lifetime and accounting

From: Joonho Lee

Date: Thu Nov 05 2026 - 02:11:42 EST


Hi Takashi,

This cumulative resend keeps the twelve-patch series on the same base,
a4311e9447bbb219044db38897f95be112f46a8a. It covers PCM stop-threshold
sampling, locked partial-progress reporting, the optional reset operation,
VirtIO ACK error propagation and recovery, PCM and control DMA ownership,
signal-safe teardown, staged capture lifecycle and work prioritization, and
capture parameter documentation.

This version addresses the v16 transport and timeout findings. Patch 6 tracks
successful virtqueue allocation so rollback does not call `del_vqs()` twice,
and so queues are released after a later event allocation failure. It also
keeps freed event-message ownership clear across freeze and restore. Patch 9
keeps jiffies timeouts and completion wait results in the kernel wait API's
return types. Patch 4 keeps ACKs rejected with `-EBADFD` during XRUN recovery
until the core publishes PREPARED, preventing a duplicate linked XRUN.

Patch 10 retains the staged capture lifecycle and DMA ownership work, and
defers linked-stream XRUN delivery while paused. The v17 follow-up arms
`stop_operating` for every member on pause, keeps a failed linked group paused
until a successful resume completes, then reports XRUN through ALSA's normal
group stop path.
Inactive `sync_stop` retires stream ownership even when the stream was not
marked stopped.

Validation:

- The complete cumulative stages 04–12 passed ARM64 `W=1` builds with KASAN,
lockdep, and OSS PCM enabled. Candidate r5 changes one line wrap in
`virtio_pcm_ops.c`; its stages 10–12 passed incremental rebuilds against the
successful stage-12 build cache.
- The MMIO partial-allocation test failed queue setup after queue 0 had been
created. Baseline reported a duplicate free-IRQ warning after transport
rollback; the candidate completed reprobe and remove without KASAN or
lockdep reports.
- A final-source r5 PCI test completed three remove/reprobe cycles and final
module removal with no kernel diagnostics.
- Linked PAUSED XRUN tests covered native pause and pause-restart. Baseline
moved the group to XRUN while paused; the candidate kept both members paused,
accepted `PAUSE_RELEASE`, and delivered XRUN after resume. DROP, peer PREPARE,
failed resume, blocked read, and close cases completed with clean fixtures.
- The final-source timeout pair used `msg_timeout_ms=2147483648` through
`snd_pcm_hw_params()`: baseline returned `-ENOENT`, candidate returned
success. A separate HZ=1000 synthetic completed-wait probe confirmed full
width for jiffies and the wait result; it is supplemental type-width
evidence, not a device request.
- Final-source production RW and MMAP reset/reopen capture ran for 70 seconds.
Seven final-source segments matched the QEMU sequence oracle; fourteen
segments were compared across baseline and candidate.

These are guest QEMU results. Physical Virtualization.framework devices,
NOMMU systems, and KCSAN were not tested.

Previous version:
https://lore.kernel.org/linux-sound/20261105023140.18373-1-mynameisjune111@xxxxxxxxx/

AI assistance was used for analysis, implementation, and test preparation.
Assisted-by: LLM

Thanks,
Joonho

base-commit: a4311e9447bbb219044db38897f95be112f46a8a