[PATCH v2 0/3] ALSA: pcm: Retain components across codec teardown
From: Cen Zhang
Date: Sat Oct 24 2026 - 07:42:18 EST
A pending PCM opener can retain the card without retaining a PCM removed
by codec-only unbind. A late codec probe can also publish PCM devices
before a subsequent registration failure starts cleanup.
Retain native and OSS PCM lookups through file release, close admission
at component disconnect, and drain codec users before probe-error cleanup.
Keep the existing proc rundown outside open_mutex at disconnect, and wait
for PCM references in final cleanup after the lookup gate is closed.
---
Cen Zhang (3):
ALSA: pcm: Retain components across native minor lookups
ALSA: pcm: oss: Retain the PCM from minor lookup through release
ALSA: hda: Drain PCM users before cleaning up a failed codec probe
include/sound/pcm.h | 11 ++++++
sound/core/oss/pcm_oss.c | 20 +++++++----
sound/core/pcm.c | 74 ++++++++++++++++++++++++++++++++++++++--
sound/core/pcm_native.c | 44 ++++++++++++++++--------
sound/hda/common/bind.c | 3 ++
5 files changed, 128 insertions(+), 24 deletions(-)
Changes in v2:
- Replace the setup-list-only fix with separate native PCM, OSS PCM and HDA
probe-error lifetime fixes.
- Retain PCM references from minor lookup through file release and roll back
partially registered minors.
- Rebase onto current for-next while preserving proc rundown outside
open_mutex at device disconnect.
- Drain codec PCM users before probe-error cleanup removes driver state.
- Describe the native HDA codec sysfs-unbind and PCM cleanup sequence
explicitly in the core patch.
Link to v1: https://lore.kernel.org/r/pm-pmb-a4703edca61d34aa679b-v6-680f350d78e44f9de7a7@xxxxxxxxx