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 X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF19CC48BD6 for ; Wed, 26 Jun 2019 03:41:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0AA52147A for ; Wed, 26 Jun 2019 03:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520498; bh=64UJjzoav9k81dLAz9IOwIUtcWqMXJ6obF0e8kbJoHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EDxawIACdhnQEBqpdR6nS8EZurWfGma92NKeyK9qBnodKZVagj02k3hyC0F5yldAC lNODfWEImuh9/Yo+nSZDXieS9IkyJl8aQnGlEr+4V1BcasBH4nafbj8hHPpS1cRUKi qn95yAOm+FyeyK2kSoBpHZWLRkkGbnHX2Z8SOUfY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfFZDlh (ORCPT ); Tue, 25 Jun 2019 23:41:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726819AbfFZDlg (ORCPT ); Tue, 25 Jun 2019 23:41:36 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (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 8A8DB20659; Wed, 26 Jun 2019 03:41:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520496; bh=64UJjzoav9k81dLAz9IOwIUtcWqMXJ6obF0e8kbJoHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mcXJy16xEfFAuU2UqNHz2mASdQ4aBI+aAs30PNp+iC2Cp5w5bUt59u2POHi62nzKk aau0YgzNgGgms1Wl3+ZsQTN0bhZEIL3fG0KWPtB4bSLY9F6gmChEd+lNmLgeG52Yue P5F9QTtm264vtD62UHK3m+SB+GKo4E2OkPHuGqxo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ranjani Sridharan , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.1 08/51] ASoC: core: lock client_mutex while removing link components Date: Tue, 25 Jun 2019 23:40:24 -0400 Message-Id: <20190626034117.23247-8-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review 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: Ranjani Sridharan [ Upstream commit 34ac3c3eb8f0c07252ceddf0a22dd240e5c91ccb ] Removing link components results in topology unloading. So, acquire the client_mutex before removing components in soc_remove_link_components. This will prevent the lockdep warning seen when dai links are removed during topology removal. Signed-off-by: Ranjani Sridharan Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a7b4fab92f26..a4668a788ed5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1008,12 +1008,14 @@ static void soc_remove_link_components(struct snd_soc_card *card, struct snd_soc_component *component; struct snd_soc_rtdcom_list *rtdcom; + mutex_lock(&client_mutex); for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; if (component->driver->remove_order == order) soc_remove_component(component); } + mutex_unlock(&client_mutex); } static void soc_remove_dai_links(struct snd_soc_card *card) -- 2.20.1