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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 447D7C47253 for ; Fri, 1 May 2020 13:31:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24F1D208D6 for ; Fri, 1 May 2020 13:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339886; bh=KvoUL5xcNE7fQQSeTKHhSEZ9Y7/6EBtFNGEhTkUrHfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Pp9EYVxVrFLUJSashqt9GTHwOGKSpBbYAj+SPsyZZxXmiHEjQq/RbWTUszuFz3fHt 3cLzfTpoVxdUCcuHRfqAI3l3a1YzI4d3qprW6AbBBs4IIRHRDQfgw0cqCiEhyS8X5K KXzFmLGhsngRPY4O65dErHiSDeyZXNtptd/9QgNY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730120AbgEANbZ (ORCPT ); Fri, 1 May 2020 09:31:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:55746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729551AbgEANbO (ORCPT ); Fri, 1 May 2020 09:31:14 -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 DB48C20757; Fri, 1 May 2020 13:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339874; bh=KvoUL5xcNE7fQQSeTKHhSEZ9Y7/6EBtFNGEhTkUrHfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RWQulS3Qiqlvn0S4+0IZ3/3k79NpNyEX6aoGRBomogd2FFD9Vs7AtZr2eNr2PcjZ/ OIg1U2yjFWw6P4VBacFwGigzHf0FKCjYwReHKNkoN9bULEIOfeADLLMSkvjay+9o5m RY0vhuZZBs2RYfeO+U0nDhIZCQl7d4P08IaHIhK8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.14 014/117] ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map() Date: Fri, 1 May 2020 15:20:50 +0200 Message-Id: <20200501131546.751570895@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131544.291247695@linuxfoundation.org> References: <20200501131544.291247695@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 From: Hans de Goede [ Upstream commit 81630dc042af998b9f58cd8e2c29dab9777ea176 ] sst_send_slot_map() uses sst_fill_and_send_cmd_unlocked() because in some places it is called with the drv->lock mutex already held. So it must always be called with the mutex locked. This commit adds missing locking in the sst_set_be_modules() code-path. Fixes: 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls") Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200402185359.3424-1-hdegoede@redhat.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/atom/sst-atom-controls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 6044b3bbb1211..999eb3ba78672 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -974,7 +974,9 @@ static int sst_set_be_modules(struct snd_soc_dapm_widget *w, dev_dbg(c->dev, "Enter: widget=%s\n", w->name); if (SND_SOC_DAPM_EVENT_ON(event)) { + mutex_lock(&drv->lock); ret = sst_send_slot_map(drv); + mutex_unlock(&drv->lock); if (ret) return ret; ret = sst_send_pipe_module_params(w, k); -- 2.20.1