From patchwork Thu Jan 10 09:02:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Kumar X-Patchwork-Id: 10755485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C7F66C2 for ; Thu, 10 Jan 2019 09:58:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE91E291FD for ; Thu, 10 Jan 2019 09:58:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2D8629314; Thu, 10 Jan 2019 09:58:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1997C2934C for ; Thu, 10 Jan 2019 09:58:11 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B3B2C26748B; Thu, 10 Jan 2019 10:58:09 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D222D2674A2; Thu, 10 Jan 2019 10:58:04 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id D9ED826712B for ; Thu, 10 Jan 2019 10:58:02 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 998D6608FC; Thu, 10 Jan 2019 09:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547110974; bh=B40pLJEFi33B2dRTxWBa3gDmBvRpqCUr3ITuOr6EK9A=; h=From:To:Cc:Subject:Date:From; b=giryIPP2yFpuKeql6SC7M/QS5egIRjRfVvDzvNSM0SkctdveWBxGacs5pfBNcuY0l 8LKv3WJy3OyOKGXjJgGGA0cuHgVQK6yZTrRPluxoHuC9qJQloPZWx7AlDAmcZml5+q VguEjzJImNyphlbmGMPbTVkC4IlF3d3fm+YRDc44= Received: from rohkumar-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 80BF06038E; Thu, 10 Jan 2019 09:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547110973; bh=B40pLJEFi33B2dRTxWBa3gDmBvRpqCUr3ITuOr6EK9A=; h=From:To:Cc:Subject:Date:From; b=KJppmrMHC9s6zuiSd7zgE06B/Tj8SBkYlWMwtiTo2ea1rzxGJmBSExXIjPCM8nE3s K7XkP0jw1bUgU2j7VizlOXydPVnXh11ibIXn8EVWFCYHe0jUg6SyWd87Zc6RY52TrN 5YTluEDqUb5UFrpvpIQAOGLRIFgvshL7ZeBFsAtY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 80BF06038E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org From: Rohit kumar To: plai@codeaurora.org, bgoswami@codeaurora.org, asishb@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org, vinod.koul@linaro.org Date: Thu, 10 Jan 2019 14:32:41 +0530 Message-Id: <1547110961-23670-1-git-send-email-rohitkr@codeaurora.org> X-Mailer: git-send-email 1.9.1 Cc: Rohit kumar , Ajit Pandey Subject: [alsa-devel] [PATCH] ASoC: soc-core: Hold client_mutex around soc_init_dai_link() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP soc_init_dai_link() calls soc_find_component() which needs to be within client_mutex lock. Add client_mutex lock around soc_init_dai_link() in snd_soc_register_card() to avoid lockdep warning. Fixes: 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list") Reported-by: Kuninori Morimoto Signed-off-by: Rohit kumar Signed-off-by: Ajit Pandey --- sound/soc/soc-core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index eec92f1..0934b36 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1027,6 +1027,7 @@ static int snd_soc_init_platform(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct snd_soc_dai_link_component *platform = dai_link->platform; + /* * FIXME * @@ -2754,15 +2755,18 @@ int snd_soc_register_card(struct snd_soc_card *card) if (!card->name || !card->dev) return -EINVAL; + mutex_lock(&client_mutex); for_each_card_prelinks(card, i, link) { ret = soc_init_dai_link(card, link); if (ret) { dev_err(card->dev, "ASoC: failed to init link %s\n", link->name); + mutex_unlock(&client_mutex); return ret; } } + mutex_unlock(&client_mutex); dev_set_drvdata(card->dev, card);