Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp504603pxb; Wed, 3 Mar 2021 08:26:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyT5Z4zafxBsst/jpJmsayFyjJk30Yot241XUv3+uRjEUux4QPgEYU4oPSQvh/LvPxUqlmX X-Received: by 2002:a50:e14d:: with SMTP id i13mr85054edl.106.1614788779971; Wed, 03 Mar 2021 08:26:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614788779; cv=none; d=google.com; s=arc-20160816; b=kLlHT65TasuOzBu73uBmZoSPhukmnQZLYPtOIh3SU43Im6xOX9TxFugmArxvUHWxEe v89FBt4pwGnHwOS0YlodoSDB2inJv/fOMCBzDeVyJfbgaUlwelrFwpZuc0rCXCPUUGUe dBvlOX7LDVuFs27e+VF3QFeW7Hf+C8wKOWFMsIrlcpT0vgT+UTCm1OXh4U/etXsjDK1X Jc4zJsUizHnJK5YZoHpkeUBGhTPRVoXxekXX/tUV/DeQ71f1Con/T/SK/5ZZlskyQ9/F EKAKRYwtRK1LzMM4ir++9zYkmVAfC43P0c5EgsdCr6QVaoRxq66+ruRTbXe7M259AQzp cF6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1MC03ohA89i5RTPSIocWYs3wPtLw54yOhgBScHAlgHg=; b=vTtDHH1PGY2KbJgHLLt2ZkaCvq4P2NQm+TFRs5obJkUFqQ0BtakA1gbJI3gPWsTTa1 6SbLp9EcjprHAgok6U9Td8fv2cRKfWkytZg2lpCfumdlFQGo5l4styXFzSP877w3N+MJ 8vSsQYYlLnAvTWr2dIjnSWZnSkhFGbJrtkLcTxFJIx2ztSEsO6IehfNrXFLWUCJ5G/pZ QijhUKHle7cxxaHcYrKi9f34GzgZF0J9UIiNhXWOqPcwERzmkWgp8AY2itIU0N7BePyT greWxoVfKI0phmiHqFP7NI7aeRrYyTwe+RuDEJiWh+/7HpwWuW0Uj4GY9ok4ZeflV3Rt KHWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=if973edN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si10004134edb.156.2021.03.03.08.25.24; Wed, 03 Mar 2021 08:26:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=if973edN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346946AbhCAXvO (ORCPT + 99 others); Mon, 1 Mar 2021 18:51:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:34282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239296AbhCASOK (ORCPT ); Mon, 1 Mar 2021 13:14:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18E2D65139; Mon, 1 Mar 2021 17:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618249; bh=+FK8FpHa6WcqRv6+hnYYgMTAEGgG/qmFLCsq7tswExE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=if973edNSMilTMK9ldNaLY4R/BtMONlIamyys/5fibzUpzy+ppe7SL93VT5CKntvD xWCrPJDflq8JlMbKNYe2qz4zpgr1uIsFiXi15St4HTgezORpDnqf1PCFA0RMs5Aaal tRge0b4wxD7ETxKCa8Mh3jnlg12PXoIma15HwBEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.10 019/663] ALSA: pcm: Dont call sync_stop if it hasnt been stopped Date: Mon, 1 Mar 2021 17:04:27 +0100 Message-Id: <20210301161142.739137166@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 700cb70730777c159a988e01daa93f20a1ae9b58 upstream. The PCM stop operation sets the stop_operating flag for indicating the sync_stop post-process. This flag is, however, set unconditionally even if the PCM trigger weren't issued. This may lead to inconsistency in the driver side. Correct the code to set stop_operating flag only after the trigger STOP is actually called. Fixes: 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation") Cc: Link: https://lore.kernel.org/r/20210206203656.15959-4-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_native.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1421,8 +1421,10 @@ static int snd_pcm_do_stop(struct snd_pc snd_pcm_state_t state) { if (substream->runtime->trigger_master == substream && - snd_pcm_running(substream)) + snd_pcm_running(substream)) { substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); + substream->runtime->stop_operating = true; + } return 0; /* unconditonally stop all substreams */ } @@ -1435,7 +1437,6 @@ static void snd_pcm_post_stop(struct snd runtime->status->state = state; snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTOP); } - runtime->stop_operating = true; wake_up(&runtime->sleep); wake_up(&runtime->tsleep); }