All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x()
@ 2013-06-05  6:49 Andreas Irestal
  2013-06-07 16:56 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Irestal @ 2013-06-05  6:49 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

From: Andreas Irestål <Andreas.Irestal@axis.com>

When calling snd_soc_dapm_sync(), it eventually tries to lock the same mutex
already locked in snd_soc_dapm_put_volsw_aic3x() and a deadlock occurs. By
moving the mutex unlock to just before snd_soc_dapm_sync(), this deadlock is
prevented. This problem was introduced in Linux 3.5

Signed-off-by: Andreas Irestål <Andreas.Irestal@axis.com>
---
 sound/soc/codecs/tlv320aic3x.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 65d09d6..1514bf8 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -187,14 +187,14 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
 
 			break;
 		}
-
-		if (found)
-			snd_soc_dapm_sync(widget->dapm);
 	}
 
-	ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
-
 	mutex_unlock(&widget->codec->mutex);
+
+	if (found)
+		snd_soc_dapm_sync(widget->dapm);
+
+	ret = snd_soc_update_bits_locked(widget->codec, reg, val_mask, val);
 	return ret;
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: codecs: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x()
  2013-06-05  6:49 [PATCH] ASoC: codecs: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x() Andreas Irestal
@ 2013-06-07 16:56 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-06-07 16:56 UTC (permalink / raw)
  To: Andreas Irestal; +Cc: alsa-devel@alsa-project.org


[-- Attachment #1.1: Type: text/plain, Size: 524 bytes --]

On Wed, Jun 05, 2013 at 08:49:47AM +0200, Andreas Irestal wrote:
> From: Andreas Irestål <Andreas.Irestal@axis.com>
> 
> When calling snd_soc_dapm_sync(), it eventually tries to lock the same mutex
> already locked in snd_soc_dapm_put_volsw_aic3x() and a deadlock occurs. By
> moving the mutex unlock to just before snd_soc_dapm_sync(), this deadlock is
> prevented. This problem was introduced in Linux 3.5

Applied but as covered in Documentation/SubmittingPatches you should
*always* CC maintainers on patches.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-07 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-05  6:49 [PATCH] ASoC: codecs: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x() Andreas Irestal
2013-06-07 16:56 ` Mark Brown

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.