From: Takashi Iwai <tiwai@suse.de>
To: Joonho Lee <mynameisjune111@gmail.com>
Cc: Takashi Iwai <tiwai@suse.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Jaroslav Kysela <perex@perex.cz>,
virtualization@lists.linux.dev, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org,
Matias Ezequiel Vara Larsen <mvaralar@redhat.com>,
Eugenio Perez <eperezma@redhat.com>
Subject: Re: [PATCH v3 0/5] ALSA: virtio: Fix request lifetime and error recovery
Date: Fri, 16 Oct 2026 16:35:18 +0200 [thread overview]
Message-ID: <877bjh3e8p.wl-tiwai@suse.de> (raw)
In-Reply-To: <cover.1791881787.git.mynameisjune111@gmail.com>
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:
> <cover.1791877396.git.mynameisjune111@gmail.com>
>
> 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
prev parent reply other threads:[~2026-10-16 14:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 8:57 [PATCH v3 0/5] ALSA: virtio: Fix request lifetime and error recovery Joonho Lee
2026-10-13 8:57 ` [PATCH v3 1/5] ALSA: virtio: Propagate PCM send failures through ACK Joonho Lee
2026-10-13 8:57 ` [PATCH v3 2/5] ALSA: virtio: Recover PCM state after a failed start Joonho Lee
2026-10-13 8:57 ` [PATCH v3 3/5] ALSA: virtio: Retain queued messages through device reset Joonho Lee
2026-10-13 8:57 ` [PATCH v3 4/5] ALSA: virtio: Keep PCM DMA buffers alive through device ownership Joonho Lee
2026-10-13 8:57 ` [PATCH v3 5/5] ALSA: virtio: Keep control payloads alive through DMA completion Joonho Lee
2026-10-16 14:35 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877bjh3e8p.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=eperezma@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mvaralar@redhat.com \
--cc=mynameisjune111@gmail.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox