]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request
authorFei Shao <fshao@chromium.org>
Fri, 17 Jun 2022 11:10:04 +0000 (19:10 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 17 Jun 2022 17:25:24 +0000 (18:25 +0100)
commit3858b18660f54802e84b272f468296659c6833f8
tree2ec7bc83ba21653f8703e9e08ece5af02da28c6f
parenta7c6bded67de64c0cba476445a14fbfebce152f4
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: 34100c9a5857 ("ASoC: mediatek: mt8186: support gpio control in platform driver")
Signed-off-by: Fei Shao <fshao@chromium.org>
Link: https://lore.kernel.org/r/20220617111003.2014395-1-fshao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8186/mt8186-afe-gpio.c