]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: rt711-sdca-sdw: fix calibrate mutex initialization
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 6 Jun 2022 20:37:47 +0000 (15:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Jul 2022 08:21:50 +0000 (10:21 +0200)
commitf85a8e86015f2074a79d30b9425eb8b66eaacf60
treec09cf3665ef1c99455b6b7ac230d7a7b1fbfb9c8
parentf3a2c0631302613f41fd8f7ce9882c633d66b9a5
ASoC: rt711-sdca-sdw: fix calibrate mutex initialization

[ Upstream commit ed0a7fb29c9fd4f53eeb37d1fe2354df7a038047 ]

In codec driver bind/unbind test, the following warning is thrown:

DEBUG_LOCKS_WARN_ON(lock->magic != lock)
...
[  699.182495]  rt711_sdca_jack_init+0x1b/0x1d0 [snd_soc_rt711_sdca]
[  699.182498]  rt711_sdca_set_jack_detect+0x3b/0x90 [snd_soc_rt711_sdca]
[  699.182500]  snd_soc_component_set_jack+0x24/0x50 [snd_soc_core]

A quick check in the code shows that the 'calibrate_mutex' used by
this driver are not initialized at probe time. Moving the
initialization to the probe removes the issue.

BugLink: https://github.com/thesofproject/linux/issues/3644
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220606203752.144159-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/rt711-sdca-sdw.c
sound/soc/codecs/rt711-sdca.c