All of lore.kernel.org
 help / color / mirror / Atom feed
From: 이경택 <gt82.lee@samsung.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Subject: RE: [PATCH 1/1] ASoC: soc-compress: lock pcm_mutex to resolve lockdep error
Date: Mon, 30 Mar 2020 10:22:21 +0900	[thread overview]
Message-ID: <000f01d60631$a96b8b50$fc42a1f0$@samsung.com> (raw)
In-Reply-To: <000101d6034a$fe37c7a0$faa756e0$@samsung.com>

On Thu, 26 Mar 2020 17:46:07 +0900,
Gyeongtaek Lee wrote:
>Hi,
>
>I'd like to send a patch to fix a problem in soc-compress with DPCM.
>soc_compr_open_fe() and soc_compr_free_fe() call snd_soc_runtime_activate()
>and snd_soc_runtime_deactivate() but don't lock card->pcm_mutex.
>It can cause lockdep error, because snd_soc_runtime_activate/deactivate()
>checks whether pcm_mutex is held using lockdep_assert_held().
>I'd like to send a patch which adds mutex_lock/unlock()
>before and after of the snd_soc_runtime_activate/deactivate() call.
>If there is anything should be changed in my patch or email,
>please let me know it.
>I'll really appreciate it.
>
>Gyeongtaek Lee (1):
>  ASoC: soc-compress: lock pcm_mutex to resolve lockdep error
>
> sound/soc/soc-compress.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>
>base-commit: 76ccd234269bd05debdbc12c96eafe62dd9a6180
>---
>
>snd_soc_runtime_activate() and snd_soc_runtime_deactivate()
>require pcm_mutex lock.
>
>Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>---
> sound/soc/soc-compress.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
>index 392a1c5b15d3..42d416ac7e9b 100644
>--- a/sound/soc/soc-compress.c
>+++ b/sound/soc/soc-compress.c
>@@ -207,7 +207,9 @@ static int soc_compr_open_fe(struct snd_compr_stream
*cstream)
> 	fe->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN;
> 	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
> 
>+	mutex_lock_nested(&fe->pcm_mutex, fe->pcm_subclass);
> 	snd_soc_runtime_activate(fe, stream);
>+	mutex_unlock(&fe->pcm_mutex);
> 
> 	mutex_unlock(&fe->card->mutex);
> 
>@@ -285,7 +287,9 @@ static int soc_compr_free_fe(struct snd_compr_stream
*cstream)
> 	else
> 		stream = SNDRV_PCM_STREAM_CAPTURE;
> 
>+	mutex_lock_nested(&fe->pcm_mutex, fe->pcm_subclass);
> 	snd_soc_runtime_deactivate(fe, stream);
>+	mutex_unlock(&fe->pcm_mutex);
> 
> 	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
> 
>-- 
>2.21.0
>
Hi,

Resending patch with removing tab expansion.

Lee


  reply	other threads:[~2020-03-30  1:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200326084608epcas2p32239121f201613573e7dd86c3172a29f@epcas2p3.samsung.com>
2020-03-26  8:46 ` [PATCH 1/1] ASoC: soc-compress: lock pcm_mutex to resolve lockdep error 이경택
2020-03-30  1:22   ` 이경택 [this message]
2020-03-30 10:33     ` Mark Brown
     [not found] <CGME20200330110126epcas2p4525e5c6f61f7452df008696f9153770d@epcas2p4.samsung.com>
2020-03-30 11:01 ` 이경택
2020-03-30 11:47   ` Vinod Koul
2020-03-31  1:54     ` 이경택
2020-04-02  2:44       ` Gyeongtaek Lee
2020-04-03  7:55       ` Vinod Koul
2020-04-09  1:32         ` Gyeongtaek Lee

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='000f01d60631$a96b8b50$fc42a1f0$@samsung.com' \
    --to=gt82.lee@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.