Alsa-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 2/2] ALSA: pcm: fix snd_pcm_link() lockdep splat
Date: Mon, 08 Jun 2020 15:02:10 +0200
Message-ID: <s5h3675678t.wl-tiwai@suse.de> (raw)
In-Reply-To: <37252c65941e58473b1219ca9fab03d48f47e3e3.1591610330.git.mirq-linux@rere.qmqm.pl>

On Mon, 08 Jun 2020 12:06:32 +0200,
Michał Mirosław wrote:
> 
> Add and use snd_pcm_stream_lock_nested() in snd_pcm_link/unlink
> implementation.  The code is fine, but generates a lockdep complaint:
> 
> ============================================
> WARNING: possible recursive locking detected
> 5.7.1mq+ #381 Tainted: G           O
> --------------------------------------------
> pulseaudio/4180 is trying to acquire lock:
> ffff888402d6f508 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xda8/0xee0 [snd_pcm]
> 
> but task is already holding lock:
> ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm]
> 
> other info that might help us debug this:
>  Possible unsafe locking scenario:
> 
>        CPU0
>        ----
>   lock(&group->lock);
>   lock(&group->lock);
> 
>  *** DEADLOCK ***
> 
>  May be due to missing lock nesting notation
> 
> 2 locks held by pulseaudio/4180:
>  #0: ffffffffa1a05190 (snd_pcm_link_rwsem){++++}-{3:3}, at: snd_pcm_common_ioctl+0xca0/0xee0 [snd_pcm]
>  #1: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm]
> [...]
> 
> Cc: stable@vger.kernel.org
> Fixes: f57f3df03a8e ("ALSA: pcm: More fine-grained PCM link locking")
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Applied now.  Thanks.


Takashi

      reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 10:06 [PATCH 0/2] ALSA: pcm: stream linking locking fixes Michał Mirosław
2020-06-08 10:06 ` [PATCH 1/2] ALSA: pcm: disallow linking stream to itself Michał Mirosław
2020-06-08 12:48   ` Takashi Iwai
2020-06-08 16:50     ` [PATCH v2] " Michał Mirosław
2020-06-08 17:35       ` Takashi Iwai
2020-06-08 10:06 ` [PATCH 2/2] ALSA: pcm: fix snd_pcm_link() lockdep splat Michał Mirosław
2020-06-08 13:02   ` 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=s5h3675678t.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --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

Alsa-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/alsa-devel/0 alsa-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 alsa-devel alsa-devel/ https://lore.kernel.org/alsa-devel \
		alsa-devel@alsa-project.org
	public-inbox-index alsa-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.alsa-project.alsa-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git