[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220617111003.2014395-1-fshao@chromium.org>
Date: Fri, 17 Jun 2022 19:10:04 +0800
From: Fei Shao <fshao@...omium.org>
To: Mark Brown <broonie@...nel.org>, Jiaxin Yu <jiaxin.yu@...iatek.com>
Cc: Fei Shao <fshao@...omium.org>, alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org
Subject: [PATCH v2] ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request
The lockdep mechanism revealed an unbalanced unlocking on MT8186:
[ 2.993966] WARNING: bad unlock balance detected!
[ 2.993978] -------------------------------------
[ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at:
[ 2.993994] [<ffffffdcd9adebf8>] mt8186_afe_gpio_request+0xf8/0x210
[ 2.994012] but there are no more locks to release!
The cause is that the mutex will be double unlocked if dai is unknown
during GPIO selection, and this patch fixes it.
Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver")
Signed-off-by: Fei Shao <fshao@...omium.org>
---
Changes in v2:
- Trimmed the commit message
sound/soc/mediatek/mt8186/mt8186-afe-gpio.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c
index 255ffba637d3..274c0c8ec2f2 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c
@@ -230,7 +230,6 @@ int mt8186_afe_gpio_request(struct device *dev, bool enable,
sel = enable ? MT8186_AFE_GPIO_PCM_ON : MT8186_AFE_GPIO_PCM_OFF;
break;
default:
- mutex_unlock(&gpio_request_mutex);
dev_err(dev, "%s(), invalid dai %d\n", __func__, dai);
goto unlock;
}
--
2.36.1.476.g0c4daa206d-goog
Powered by blists - more mailing lists