From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DBB5C43334 for ; Thu, 14 Jul 2022 04:31:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 97CBE17A3; Thu, 14 Jul 2022 06:30:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97CBE17A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657773101; bh=hrhyR0PquUIdfLfSQKpeMvCnSErNrBrDbTXMT4JsZmQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eUnzk7mP37/UbQ4uGeCSAa+sNQb3qc/NjIx+Awn7weAiwKpqBYe9ZO9JrheypnUTg U1kscEoaCz1Zxm4wR9hQWDeBmlgnRzuDABfgzvhoVWXURqbHg9Z8S4kWrNZ2cLC0mk DIBzfkMfvDnWPxdpf8eGeetcQuotD7btg2w30NIk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 55B2CF80605; Thu, 14 Jul 2022 06:24:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2228FF80578; Thu, 14 Jul 2022 06:24:49 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 53BC8F8055A for ; Thu, 14 Jul 2022 06:24:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 53BC8F8055A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eHyFDctA" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1101A61E5C; Thu, 14 Jul 2022 04:24:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36814C36AE3; Thu, 14 Jul 2022 04:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772679; bh=hrhyR0PquUIdfLfSQKpeMvCnSErNrBrDbTXMT4JsZmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eHyFDctA9vgrTxoX/rnxYK77gNN2Vg3R1hKF40KLoWpYzA5d33CupyKRuSfWxwY2r 3zVOqcphBvQnAnw4tPuLXAYl/3eG1H6//eOkhTWctAFLqZpk+jUimue0MP6Ld42oh6 4r4f2Ob7/uWyAe7Cyh9VPaYZIR6f8stispTine9XMAvQ/HxY634+AfwiwtueuveYKG 8I7tdpzJUweQWAYWFike0vKpiuIkEfmnM/+AtTR91IM9guu+oVke7E5UWJnICZZJKl 79jWwkOnFnUAm7P2lnzqbMhcBEG7oDq60aGiVoB/BFkF3aK9dR6F20BTXN4rTy7IJk Ebr+6O4gTj8tw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 04/28] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Date: Thu, 14 Jul 2022 00:24:05 -0400 Message-Id: <20220714042429.281816-4-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042429.281816-1-sashal@kernel.org> References: <20220714042429.281816-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , oder_chiou@realtek.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, tiwai@suse.com, Pierre-Louis Bossart , Rander Wang , Mark Brown , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Pierre-Louis Bossart [ 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 Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt711-sdca-sdw.c | 3 +++ sound/soc/codecs/rt711-sdca.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c index c722a2b0041f..a085b2f530aa 100644 --- a/sound/soc/codecs/rt711-sdca-sdw.c +++ b/sound/soc/codecs/rt711-sdca-sdw.c @@ -373,6 +373,9 @@ static int rt711_sdca_sdw_remove(struct sdw_slave *slave) if (rt711->first_hw_init) pm_runtime_disable(&slave->dev); + mutex_destroy(&rt711->calibrate_mutex); + mutex_destroy(&rt711->disable_irq_lock); + return 0; } diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c index 2e992589f1e4..f041e036b05f 100644 --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -1411,6 +1411,7 @@ int rt711_sdca_init(struct device *dev, struct regmap *regmap, rt711->regmap = regmap; rt711->mbq_regmap = mbq_regmap; + mutex_init(&rt711->calibrate_mutex); mutex_init(&rt711->disable_irq_lock); /* @@ -1549,7 +1550,6 @@ int rt711_sdca_io_init(struct device *dev, struct sdw_slave *slave) rt711_sdca_jack_detect_handler); INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_sdca_btn_check_handler); - mutex_init(&rt711->calibrate_mutex); } /* calibration */ -- 2.35.1