[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87cz1jwgsh.wl-tiwai@suse.de>
Date: Sun, 25 Jun 2023 20:14:22 +0200
From: Takashi Iwai <tiwai@...e.de>
To: YE Chengfeng <cyeaa@...nect.ust.hk>
Cc: "perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"pteerapong@...omium.org" <pteerapong@...omium.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ALSA: aloop: Fix &cable->lock deadlock issues
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
Powered by blists - more mailing lists