From: Takashi Iwai <tiwai@suse.de>
To: "Ali Ahmet Memiş" <aliamemis@disroot.org>
Cc: Takashi Iwai <tiwai@suse.de>, Takashi Iwai <tiwai@suse.com>,
Jaroslav Kysela <perex@perex.cz>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect
Date: Mon, 12 Oct 2026 16:51:40 +0200 [thread overview]
Message-ID: <87h5irgef7.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261012141238.1823718-1-aliamemis@disroot.org>
On Mon, 12 Oct 2026 16:12:35 +0200,
Ali Ahmet Memiş wrote:
>
> On Mon, 12 Oct 2026 09:24:26 +0200, Takashi Iwai wrote:
> > Hm, it's not clear to me how this happens: I see no controls_rwsem
> > down around snd_ctl_led_disconnect() call. Could you elaborate about
> > it a bit more?
>
> It's taken in the call_snd_ctl_lops() macro in control.c:
>
> guard(rwsem_read)(&(_card)->controls_rwsem);
> guard(rwsem_read)(&snd_ctl_layer_rwsem);
>
> so snd_ctl_dev_disconnect() calls ->ldisconnect() with controls_rwsem
> held for read. snd_ctl_led_sysfs_remove() then waits in kernfs_drain()
> for the attach write which is blocked on down_write(controls_rwsem) in
> snd_ctl_led_set_id().
Thanks, now it's clearer.
The patch is applied to for-next branch now.
thanks,
Takashi
prev parent reply other threads:[~2026-10-12 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 18:06 [PATCH] ALSA: control_led: Fix deadlock between sysfs writes and card disconnect Ali Ahmet Memiş
2026-10-12 7:24 ` Takashi Iwai
2026-10-12 14:12 ` Ali Ahmet Memiş
2026-10-12 14:51 ` 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=87h5irgef7.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=aliamemis@disroot.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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