From: Carlos Llamas <cmllamas@google.com>
To: Mark Brown <broonie@kernel.org>
Cc: yixuanjiang <yixuanjiang@google.com>,
vkoul@kernel.org, lgirdwood@gmail.com, perex@perex.cz,
tiwai@suse.com, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ASoC: soc-compress: Fix deadlock in soc_compr_open_fe
Date: Thu, 15 Jun 2023 15:26:07 +0000 [thread overview]
Message-ID: <ZIstjzsar5a4bCFN@google.com> (raw)
In-Reply-To: <92159f51-2e17-4c6b-8fd4-0bde8b1dd38a@sirena.org.uk>
On Thu, Jun 15, 2023 at 01:56:35AM +0100, Mark Brown wrote:
> On Tue, Jun 13, 2023 at 02:23:50PM +0800, yixuanjiang wrote:
> > Modify the error handling flow by release lock.
> > The require pcm_mutex will keep holding if open fail.
>
> > +++ b/sound/soc/soc-compress.c
> > @@ -166,6 +166,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
> > snd_soc_dai_compr_shutdown(cpu_dai, cstream, 1);
> > out:
> > dpcm_path_put(&list);
> > + mutex_unlock(&fe->card->pcm_mutex);
> > be_err:
>
> This is really hard to follow due to the lack of any mutex_lock()s in
> the function, I think because this is intended to undo
> snd_soc_dpcm_mutex_lock(fe) but if that's the case why is it not using
> snd_soc_dpcm_mutex_unlock(fe) like the success path does? Given the use
> of classes not doing that looks like it'll create lockdep issues.
>
> I'd expect the unlock to match the lock.
Yes, and judging from the context of the patch I believe this was based
off of stable 5.15.y tree. The locking has been refactored since. So
Yixuan, please rebase/adjust your patch on top of Linus's mainline tree
and resend. Thanks!
--
Carlos Llamas
next prev parent reply other threads:[~2023-06-15 15:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 6:23 [PATCH] ASoC: soc-compress: Fix deadlock in soc_compr_open_fe yixuanjiang
2023-06-15 0:56 ` Mark Brown
2023-06-15 15:26 ` Carlos Llamas [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-06-19 3:31 yixuanjiang
2023-06-21 15:29 ` Mark Brown
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=ZIstjzsar5a4bCFN@google.com \
--to=cmllamas@google.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=yixuanjiang@google.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