Commit 5faf071d authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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:

316fa9e0 ("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: ce8bcdbb ("ASoC: samsung: i2s: Protect more registers with a spinlock")
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1001354c
...@@ -1029,12 +1029,13 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai) ...@@ -1029,12 +1029,13 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
static int samsung_i2s_dai_remove(struct snd_soc_dai *dai) static int samsung_i2s_dai_remove(struct snd_soc_dai *dai)
{ {
struct i2s_dai *i2s = snd_soc_dai_get_drvdata(dai); struct i2s_dai *i2s = snd_soc_dai_get_drvdata(dai);
unsigned long flags;
if (!is_secondary(i2s)) { if (!is_secondary(i2s)) {
if (i2s->quirks & QUIRK_NEED_RSTCLR) { if (i2s->quirks & QUIRK_NEED_RSTCLR) {
spin_lock(i2s->lock); spin_lock_irqsave(i2s->lock, flags);
writel(0, i2s->addr + I2SCON); writel(0, i2s->addr + I2SCON);
spin_unlock(i2s->lock); spin_unlock_irqrestore(i2s->lock, flags);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment