Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4F1AC433FE for ; Mon, 14 Nov 2022 13:01:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8ECB51634; Mon, 14 Nov 2022 14:00:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8ECB51634 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668430868; bh=o255Oh3xD5qeF+OBbW+SP7SqQXzJHLMt+bzReQzweuc=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nHf/kG3vaLDZwz36Yc0kUuk7d47haKSYHnwYPfL3XyqN0b4FY3CFnBHzX6z1SMY1p QXeeeuUG6LCY47wqEkpruLpDpE02ENV59TaJjhER7Dj9jOHskMBpZ62jeG9Oy+937X dN0+EWcVk5AAM2pcuJUdpYbCfiYMMa4F+XxRfSRY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 310ECF800B8; Mon, 14 Nov 2022 14:00:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99A08F80431; Mon, 14 Nov 2022 14:00:16 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5E54CF800B6 for ; Mon, 14 Nov 2022 14:00:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5E54CF800B6 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="xuAyTkKy"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="wZI9XIrY" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A5F6B1FF89; Mon, 14 Nov 2022 13:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668430813; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s/WPbw/AMEorB1CCCi4GiZyellql7WmBw5x7og70YKI=; b=xuAyTkKyZxdJgUrUiTMFV0pHbZ+rdMaHKZON8ZUHImhXrXLE/8IAqbCKbpYVEcGeFD+hMX MQDut8mSVJg7RmIApcw+b/nn95JAFVacgosMTDd4VIJ1sP0Lnx6OwAF4Hmj+vsS46q63Qk WcPWoxOKv2SfwOumeeHLVz3EEFAU04I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668430813; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s/WPbw/AMEorB1CCCi4GiZyellql7WmBw5x7og70YKI=; b=wZI9XIrYa5qr4Hm9Nljpx2ha8QIN7zDZykU9bxh1Pq7Lmylf2XloU7FoZ5UauacAc2lZoW /jYs6cN0AdDT6nAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6AF1613A8C; Mon, 14 Nov 2022 13:00:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 73RFGd07cmO0NwAAMHmgww (envelope-from ); Mon, 14 Nov 2022 13:00:13 +0000 Date: Mon, 14 Nov 2022 14:00:12 +0100 Message-ID: <878rkd4roj.wl-tiwai@suse.de> From: Takashi Iwai To: Cezary Rojewski Subject: Re: [PATCH v2 1/2] ASoC: Intel: avs: Lock substream before snd_pcm_stop() In-Reply-To: <20221114113729.1022905-2-cezary.rojewski@intel.com> References: <20221114113729.1022905-1-cezary.rojewski@intel.com> <20221114113729.1022905-2-cezary.rojewski@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, broonie@kernel.org, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 14 Nov 2022 12:37:28 +0100, Cezary Rojewski wrote: > > snd_pcm_stop() shall be called with stream lock held to prevent any > races between nonatomic streaming operations. > > Fixes: 2f1f570cd730 ("ASoC: Intel: avs: Coredump and recovery flow") > Signed-off-by: Cezary Rojewski > --- > sound/soc/intel/avs/ipc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sound/soc/intel/avs/ipc.c b/sound/soc/intel/avs/ipc.c > index 152f8d0bdf8e..07655298b6c7 100644 > --- a/sound/soc/intel/avs/ipc.c > +++ b/sound/soc/intel/avs/ipc.c > @@ -123,7 +123,9 @@ static void avs_dsp_recovery(struct avs_dev *adev) > if (!substream || !substream->runtime) > continue; > > + snd_pcm_stream_lock(substream); > snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); > + snd_pcm_stream_unlock(substream); Isn't it in the interruptible context? If so, you need the _irq() variant. Takashi