From: Takashi Iwai <tiwai@suse.de>
To: YE Chengfeng <cyeaa@connect.ust.hk>
Cc: "perex@perex.cz" <perex@perex.cz>,
"tiwai@suse.com" <tiwai@suse.com>,
"pteerapong@chromium.org" <pteerapong@chromium.org>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ALSA: aloop: Fix &cable->lock deadlock issues
Date: Sun, 25 Jun 2023 20:14:22 +0200 [thread overview]
Message-ID: <87cz1jwgsh.wl-tiwai@suse.de> (raw)
In-Reply-To: <TYCP286MB11886E8193AD36C16451A0AC8A21A@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM>
On Sun, 25 Jun 2023 18:22:56 +0200,
YE Chengfeng wrote:
>
> The timer loopback_jiffies_timer_function is executed under
> bottom-half softirq context and require a spinlock, thus
> other process context code requiring the same lock (i.e.,
> loopback_trigger, loopback_pointer) can deadlock with the
> timer if it is preempted while holding the lock.
>
> Deadlock scenario:
> loopback_trigger
> -> spin_lock(&cable->lock);
> <timer interrupt>
> -> loopback_jiffies_timer_function
> -> spin_lock_irqsave(&dpcm->cable->lock, flags);
>
> Fix the potential deadlock by using spin_lock_irqsave.
Similarly like the patch for snd-dummy, this change looks superfluous,
too.
thanks,
Takashi
prev parent reply other threads:[~2023-06-25 18:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-25 16:22 [PATCH] ALSA: aloop: Fix &cable->lock deadlock issues YE Chengfeng
2023-06-25 18:14 ` 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=87cz1jwgsh.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=cyeaa@connect.ust.hk \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pteerapong@chromium.org \
--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