Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp248141ybd; Tue, 25 Jun 2019 20:42:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxirgf+OCovrUTKIHZb0qv1TAx5J2BTxPj3F9rrl7vtI1cl/L+FxgkiO2/Wq5j2f0kcuUxl X-Received: by 2002:a17:90a:2008:: with SMTP id n8mr1796773pjc.4.1561520535636; Tue, 25 Jun 2019 20:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520535; cv=none; d=google.com; s=arc-20160816; b=WeiJ7cFp4qb2G5wOCb71+tMrs6fPKucZuuc+xEHEabaT7SWIDCSYi91SmpF6yknpZn 1yKkX75dse1Qw+umsgXfuw8p18YIaa+94gKOO14DuI2sRP8Hr3o+JgCwb0kLKOyOhFFu Z6BRZPGOebcsGVF0Nm8YJxEzZZYO6Y5YQDkJsHV6Dr17cFWBBgBeYhxmQKSPMQhi71gb hZlaoa7bIvFe4K44m1yIQomFD62TZcHdIE49WImNRtNVlf/fXTHvONAB7LEEtxIEcka/ kloZaoo1lxzj59c31oYlO+capcdKnVtORKSRPg/EnWMSMA/9U3rzyADV4hvHJZ30pywy n3OQ== 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=OV2RqC0kLzplYQ2yta7IVZ+Z/suQlhPQnP2wO+0tWQo=; b=juww5iv6fs1pNzm9oqqLMLC/qxwh0buYSZ4XyI/pxU0vcbcxfvuy1lG733UP7VcWaA oszYtSSLIwPs08KAS40adipNkS17c/suhLH2XkrvgSxbgk8l1rHaTuUZ7VlohUZqXIMm 4fSbJx907hpEqor8WKUFVJj+Bc9SGipZv6M8LsP+idm2t8GucBvHP16lX7EeS4yo9OjZ Y1a9TEBK9Lxd7gE8xgSBbYwvTRLLCCqho31NmnoLhyijUnAO7rUPvJV1esGQn5Ewmizc vIJuevob5YwQBv7cvuMlptHljmOv4zW5KFzJwvI0+6/3JrAiHIPLvIaJ3cy+CzWz0iPw vtVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mcXJy16x; 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 h12si828451pjt.4.2019.06.25.20.41.59; Tue, 25 Jun 2019 20:42:15 -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=mcXJy16x; 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 S1726836AbfFZDlh (ORCPT + 99 others); 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