mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Timo Wischer <twischer@de.adit-jv.com>
Subject: Re: [PATCH 1/2] ALSA: aloop: Remove redundant locking in timer open function
Date: Fri, 22 Nov 2019 19:13:54 +0100	[thread overview]
Message-ID: <s5hk17r22zh.wl-tiwai@suse.de> (raw)
In-Reply-To: <20191122175218.17187-1-andrew_gabbasov@mentor.com>

On Fri, 22 Nov 2019 18:52:17 +0100,
Andrew Gabbasov wrote:
> 
> loopback_parse_timer_id() uses snd_card_ref(), that can lock on mutex,
> also snd_timer_instance_new() uses non-atomic allocation, that can sleep.
> So, both functions can not be called from loopback_snd_timer_open()
> with cable->lock spinlock locked.
> 
> Moreover, most part of loopback_snd_timer_open() function body works
> when the opposite stream of the same cable does not yet exist, and
> the current stream is not yet completely open and can't be running,
> so existing locking of loopback->cable_lock mutex is enough to protect
> from conflicts with simultaneous opening or closing.
> Locking of cable->lock spinlock is not needed in this case.
> 
> Fixes: 26c53379f98d ("ALSA: aloop: Support selection of snd_timer instead of jiffies")
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>

Applied, thanks.


Takashi

      parent reply	other threads:[~2019-11-22 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 17:52 Andrew Gabbasov
2019-11-22 17:52 ` [PATCH 2/2] ALSA: aloop: Avoid unexpected timer event callback tasklets Andrew Gabbasov
2019-11-22 18:14   ` Takashi Iwai
2019-11-22 18:13 ` 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=s5hk17r22zh.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrew_gabbasov@mentor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=twischer@de.adit-jv.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

all inboxes | Powered by JetHome®