mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Cen Zhang <zzzccc427@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, tiwai@suse.de,
	baijiaju1990@gmail.com, jjzuming@gmail.com
Subject: Re: [PATCH v2 0/3] ALSA: pcm: Retain components across codec teardown
Date: Mon, 26 Oct 2026 09:39:21 +0100	[thread overview]
Message-ID: <87o6cg6ekm.wl-tiwai@suse.de> (raw)
In-Reply-To: <pm-pmb-a4703edca61d34aa679b-v9-c4f3df026f28aea10fd1-0@gmail.com>

On Sat, 24 Oct 2026 13:41:13 +0200,
Cen Zhang wrote:
> 
> 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

I guess fixing in lower layer would become a whack-a-mole game.

My current thought is to rather plug on the upper layer, that is:

- Serialize concurrent probe and remove calls for the same HD-audio
  bus

- At remove, synchronize the all opened fds on the card; you can check
  list_empty(&card->files_list) and notify from snd_card_file_remove()
  call.

The proc files are removed and synced at disconnection, so the above
should cover most of corner cases, I suppose.


thanks,

Takashi

      parent reply	other threads:[~2026-10-26  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 11:41 Cen Zhang
2026-10-24 11:41 ` [PATCH v2 1/3] ALSA: pcm: Retain components across native minor lookups Cen Zhang
2026-10-24 11:41 ` [PATCH v2 2/3] ALSA: pcm: oss: Retain the PCM from minor lookup through release Cen Zhang
2026-10-24 11:41 ` [PATCH v2 3/3] ALSA: hda: Drain PCM users before cleaning up a failed codec probe Cen Zhang
2026-10-26  8:39 ` 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=87o6cg6ekm.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=baijiaju1990@gmail.com \
    --cc=jjzuming@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zzzccc427@gmail.com \
    /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

all inboxes | Powered by JetHome®