aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-10-21 09:18:48 -0400
committerMark Brown <broonie@kernel.org>2016-10-24 14:00:01 -0400
commit5faf071d08ddd1c1be66deaa93a09ccf43f5b538 (patch)
treec87ff0c41b7990cd45e2e8b881181ce7ed21f52f
parent1001354ca34179f3db924eb66672442a173147dc (diff)
ASoC: samsung: i2s: Fixup last IRQ unsafe spin lock call
Unfortunately, I seem to have missed a case where an IRQ safe spinlock was required, in samsung_i2s_dai_remove, when I fixed up the other calls in this patch: 316fa9e09ad7 ("ASoC: samsung: Use IRQ safe spin lock calls") This causes a lockdep warning when unbinding and rebinding the audio card: [ 104.357664] CPU0 CPU1 [ 104.362174] ---- ---- [ 104.366692] lock(&(&pri_dai->spinlock)->rlock); [ 104.371372] local_irq_disable(); [ 104.377283] lock(&(&substream->self_group.lock)->rlock); [ 104.385259] lock(&(&pri_dai->spinlock)->rlock); [ 104.392469] <Interrupt> [ 104.395072] lock(&(&substream->self_group.lock)->rlock); [ 104.400710] [ 104.400710] *** DEADLOCK *** Fixes: ce8bcdbb61d9 ("ASoC: samsung: i2s: Protect more registers with a spinlock") Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/i2s.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 7e32cf4581f8..588aa0160a3f 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1029,12 +1029,13 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
1029static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) 1029static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
1030{ 1030{
1031 struct i2s_dai *i2s = snd_soc_dai_get_drvdata(dai); 1031 struct i2s_dai *i2s = snd_soc_dai_get_drvdata(dai);
1032 unsigned long flags;
1032 1033
1033 if (!is_secondary(i2s)) { 1034 if (!is_secondary(i2s)) {
1034 if (i2s->quirks & QUIRK_NEED_RSTCLR) { 1035 if (i2s->quirks & QUIRK_NEED_RSTCLR) {
1035 spin_lock(i2s->lock); 1036 spin_lock_irqsave(i2s->lock, flags);
1036 writel(0, i2s->addr + I2SCON); 1037 writel(0, i2s->addr + I2SCON);
1037 spin_unlock(i2s->lock); 1038 spin_unlock_irqrestore(i2s->lock, flags);
1038 } 1039 }
1039 } 1040 }
1040 1041