Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7150618ybi; Mon, 8 Jul 2019 15:39:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrTFKBatxSy0gYvCKIqDe/oPUhO++BQaVS6U34oN0nFTtIMGaq+ZQqli5Y/kHY6jJLbMa0 X-Received: by 2002:a17:90a:b00b:: with SMTP id x11mr28864950pjq.120.1562625592111; Mon, 08 Jul 2019 15:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625592; cv=none; d=google.com; s=arc-20160816; b=Eg9oJPj0C4+2mlnxk/POS3LcZOd4vrr/WNIgrrUwKfXZyHw41GKIPsZ3C074jgItee 889tuhx5Rbeir5N2ILgjbVdt+POjBbu6evbEf0QHVseXoFoU8TVN2POFD4Byu28vrI25 +77gCEJrMhkOZTfXLe0wYwC4QgW8BdGhE7v0Rjh8FT1kyTA5vmgq9dFm81QEbU+X9BUl 79Fnfw6Hsb2h50duno7T/na+cVItHEunfBAhELR6EMi3+58s7tlWZrI5//DCZNKKb3hh 8TvquGnRwpA0brMAyQxTRzSEGqOfAxmL5OhbJC16JA2rWGIt4qEDYMrR/EqH80NYKXqu 84cg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rSX88RgC3SmSGcHdoUxVFChlXhbcuORb2AHsJG87A6A=; b=J1OBV3K86Aff1xB40hr214fzuYpvKwekoQAZ+IJT6v9aEPntFZbJVk31rrkN2Mftfi cU4uwhHNgAD6nv9z/cTlvlqZ3cwsunoAWnLja+YDc/+o8uIuvcWgsoMlIy1DE/tPSnsF Qk0A7rFMidJdAxTFIEi2QVZqMCLCp7bLzr4irH/s7ma8lwFI7JQswUxMTd7ju5F1eAMP WvRBy59V4icA2pVGFlhf/0iELyCDUiEpoesd/Q6Jy6IdoTkmX5wpZvAwEVzAV9ettVDB jIrUr+70/aP85iyev9+NY3g4R0X+8zA0sHsoha9oq0KftEJcMSVSR1m1b1TXs5Kww77A HkQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sWrM2T/L"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cx7si700492pjb.51.2019.07.08.15.39.37; Mon, 08 Jul 2019 15:39:52 -0700 (PDT) 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="sWrM2T/L"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389600AbfGHPbC (ORCPT + 99 others); Mon, 8 Jul 2019 11:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:60246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389568AbfGHPbB (ORCPT ); Mon, 8 Jul 2019 11:31:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10F3D21537; Mon, 8 Jul 2019 15:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599861; bh=123LvG5HBWrU6fX8TV7jwY6aig2FA9GCYpsfdvH6b/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sWrM2T/LYXzQdPZhzpU2NsTOazgmQPeql/rWm4OwOpSH/c9CR45zcQUfuJclbLMdM LgsI7+NlUNZ7XFDnpPnLbH7xkmAJAzPxxJ4TCtAlj9IRPrRCOX8WbOV8Hoos2GS2CS S0o77fR8Ugb+Plo4rrhtA7ylRo1lD8j9XoD9xraM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ranjani Sridharan , Mark Brown , Sasha Levin Subject: [PATCH 5.1 14/96] ASoC: core: lock client_mutex while removing link components Date: Mon, 8 Jul 2019 17:12:46 +0200 Message-Id: <20190708150527.154167492@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150526.234572443@linuxfoundation.org> References: <20190708150526.234572443@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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