Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp209255imj; Thu, 14 Feb 2019 18:45:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IZpi8A5ocTVqu6Xx1kPqeS20phG2cemt7zKd8vEXoiK9CaXA9uirbSZdMmEueaM7bMigkfC X-Received: by 2002:a63:4c18:: with SMTP id z24mr3139554pga.62.1550198710645; Thu, 14 Feb 2019 18:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198710; cv=none; d=google.com; s=arc-20160816; b=Sc7Feqs8/0J+Ewh3BuweLvKJTyqQEmEID6+UPD5WBvHzbW+oDHhkDXtTE4DcUkeC6T Ci9sNsVjA++p0dmAtRWcF2anJmd/PHEcRmWA4tytzbgGSMvQ1Bzcd9XLFYBicsZ4+X6h 6kzm2/RW9xa4RnjYhUBmNiXEZklPU7/UD9jL4sZVfn8jtt3uHwco5RqDU4+ZHprOxZec 7oUQtGyPTyAasLVJ+wtUJmnhQvYnhwQcRBI8LGib+JeRnmky/HBYQArgr5a4TtFEZgNL xzzramAcba6CzVPD41y+l1I4Of5MEHizmVpJAIHIq+NeMQOURXkNTaAbTaGHJdoXFxD0 ZKKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SfwP8MHcQonT76gFsrv4N+UmrESJT/jvWRn05yh4VOM=; b=pXtadmg1+CsEELcyFCA314mxBUK68PgwB5Mi5wc5rV1wqRSXNxhuJBmZLT8/fdv9ii 9znsR8CtNRIae+LD9Euon5XL/6LO94i/BN6TqU4U2bhx+LctBePqC0NOvsuoRxRdkKgu +QvP6PHgWOIx92ECQDVFTV7ZL/F1PLpgbjSU9UDquL8+uOSwn08e6P0brMCSw+JoP5S8 FCeZDmdh9T7hOG+WwSuaxsO7xkDsVjoh/Whid+mi5Ky0eQhaOxG1WTZ5D3E9wHQXIcge TpWoqXEFQ7Wa6mh3W+mTmomTH3qGRI2ULZD/iyxr6w3jUbjF4RCYonMvNYCOrnmq56ui XlYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P3lr1m6D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u26si1186457pfh.113.2019.02.14.18.44.54; Thu, 14 Feb 2019 18:45:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P3lr1m6D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbfBOCmn (ORCPT + 99 others); Thu, 14 Feb 2019 21:42:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:49400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731545AbfBOCJL (ORCPT ); Thu, 14 Feb 2019 21:09:11 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB6C5206BA; Fri, 15 Feb 2019 02:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196550; bh=mCLY9l9vTMsa1CECzFczBaVueKplL14xfsMm0i6+fQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P3lr1m6DUplcduEP6ZtEc2tviItyHMzpjN9gf4WCcRX7vEGVQ9MMdxIqLdl/7cha9 3ouC52nmmoHF6FZRxKZ4iOltJJ+ondvr1mMMZ8In35u2Ao2uyXH79WmUAWJY3P6rtP vPoGwAZZibk5xjGFU6ic8oMhedulN2AhWkdHROxc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rohit kumar , Ajit Pandey , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.20 10/77] ASoC: soc-core: Hold client_mutex around soc_init_dai_link() Date: Thu, 14 Feb 2019 21:07:48 -0500 Message-Id: <20190215020855.176727-10-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rohit kumar [ Upstream commit 04eb1efcd614d6f067b76a355b3a3599667959dc ] 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 Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 74b12f90ea9b..0b91d8fc6ca2 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); -- 2.19.1