Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4450490imw; Tue, 19 Jul 2022 06:53:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/EuYSKyYvMhWJsnqyUpHyNly+xGJjz6L3SM/7XcS71UoFz9P4199UdAQIQAJ8LPcK2U43 X-Received: by 2002:a17:907:7615:b0:72b:35a6:5992 with SMTP id jx21-20020a170907761500b0072b35a65992mr30335564ejc.97.1658238837523; Tue, 19 Jul 2022 06:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238837; cv=none; d=google.com; s=arc-20160816; b=uV4yVS7pj51IYL4h66s87n2wAYC/v2CwfQ//i5RzUYgM5iBjSBqbP10+ppJ4z+YCx6 bq+9Cc26aKTUstuw+oORdRAxh7kSPWnJ2CFNhMqxZmy9PRaXu/h2p6YsgrXF7rSJek8L mDWPJYMegXmojGz2cZy888r4/P7b7FL/ppDT9ZH0hki11sTqTLn+uJDZ5l2c9GFNMPsa Npwg7pjZubYtgEBQcXcxNBsfz25LGbfeP36DBozXDz5MwEp/oO6bYuj2OEKWtkPVegSn D9mtf9csHi21yfrnoMw9SaXccRgk8KzwAHlIjwybamtFvEqsRuHRWYE86Gns4rwD9znS TK/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EjAurRRI2tUd1PwykN1TYVaolkFhfUi0bstWtMQ5CBI=; b=XjqkDD6Aq77edsFJVrMelHGUFrktbBJvnt5WfZCnY/uSy0yYPKvTYo3NwhtPAQj527 KJ4eOdIpR/h3b3twGYUwjtHvfwuibygz0cyuU8TxHfkFkKCaCj3CnTTYom1XJiTIRIZS XdKtHMLPzW9uZ8kwtOhe8IjNAQprN+KO25tsEtBwsf0W0GYLanLBTO07dViauHgAu/rW ybYKaQqoTe5zoK7dxp81QhapDosZHJQM8D2gpDOu3h0ZKQ72JnPL5+RBllZDZ2GXA1z/ Je+XFCNnyuxdjlHfcBOA8FthD9154gB3l856dMMw7bMvIEONsABIPKzisjH+5qd1U84I /ymA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c4nwaMN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a056402439200b0043a72e21988si15963823edc.590.2022.07.19.06.53.33; Tue, 19 Jul 2022 06:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c4nwaMN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241148AbiGSMns (ORCPT + 99 others); Tue, 19 Jul 2022 08:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241398AbiGSMnM (ORCPT ); Tue, 19 Jul 2022 08:43:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08FE880535; Tue, 19 Jul 2022 05:16:45 -0700 (PDT) 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 6F5CE61772; Tue, 19 Jul 2022 12:16:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54E16C341C6; Tue, 19 Jul 2022 12:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232987; bh=DX8GnNXoZmg5Xm54obL/bmHPMlMYP2TaYkBJHhzBO74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c4nwaMN4MsFQQnnX6PrAiJ2MUJnrDNLcZhluMJgiZbe/ATpDu5iKN1HtVUYYs04AO W56Z8Yimhgvf86RcEmg80HMLVQiWecjlvEH1F2/ZASib/ool82bifG0fm6J1QOWgAi Z5eb5S+rzKyGLH3GMp/exLjx6CXVpCSOFpdobzt8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Bard Liao , Mark Brown , Sasha Levin Subject: [PATCH 5.15 134/167] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Date: Tue, 19 Jul 2022 13:54:26 +0200 Message-Id: <20220719114709.516587635@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) --- 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 if (rt711->first_hw_init) pm_runtime_disable(&slave->dev); + mutex_destroy(&rt711->calibrate_mutex); + mutex_destroy(&rt711->disable_irq_lock); + return 0; } --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -1414,6 +1414,7 @@ int rt711_sdca_init(struct device *dev, rt711->regmap = regmap; rt711->mbq_regmap = mbq_regmap; + mutex_init(&rt711->calibrate_mutex); mutex_init(&rt711->disable_irq_lock); /* @@ -1552,7 +1553,6 @@ int rt711_sdca_io_init(struct device *de rt711_sdca_jack_detect_handler); INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_sdca_btn_check_handler); - mutex_init(&rt711->calibrate_mutex); } /* calibration */