[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87edlzwgti.wl-tiwai@suse.de>
Date: Sun, 25 Jun 2023 20:13:45 +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>,
"yunjunlee@...omium.org" <yunjunlee@...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: dummy: Fix &dpcm->lock deadlock issues
On Sun, 25 Jun 2023 17:35:48 +0200,
YE Chengfeng wrote:
>
> The timer dummy_systimer_callback is executed under softirq
> context, thus other process context code requiring the same lock
> should disable interrupt. Otherwise there would be potential
> deadlock issues when the code executing under process context
> (i.e., dummy_systimer_pointer, dummy_systimer_start,
> dummy_systimer_stop) is preempted by the timer while holding
> the lock.
>
> Deadlock scenario:
> dummy_systimer_pointer
> -> spin_lock(&dpcm->lock);
> <timer interrupt>
> -> dummy_systimer_callback
> -> spin_lock_irqsave(&dpcm->lock, flags);
>
> Fix the potential deadlock by using spin_lock_irqsave.
Did you really trigger this deadlock, or is just your hypothesis?
I'm asking it because basically the deadlock above shouldn't happen;
those are called only via PCM trigger and pointer callbacks, and they
are always called inside the PCM stream lock, and already
irq-disabled.
thanks,
Takashi
Powered by blists - more mailing lists