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 BA839C4332F for ; Mon, 14 Nov 2022 13:29:16 +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 E0F07161F; Mon, 14 Nov 2022 14:28:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E0F07161F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668432554; bh=FR65zF7LII8HUbnC0SvyPQuEbAVw4R18/FJYha4NScA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Rvflpu0uRCwjAeYsSh1+q+Yyy5H9ykUki27I7+qw9iZ75opCNkWy3kfQjqPfmfszT rGNz54ma/jL4w/+GurLTiyTVsXP0k43HcOkartwAvVNyDvStOtURsPPe2q3OLQjfYY DLZe6NIqwfGF7LYxdFJOrTEKcL0lJK1OD/Qu5dJM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9677FF800B8; Mon, 14 Nov 2022 14:28:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73983F80431; Mon, 14 Nov 2022 14:28:22 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 AD9B9F800B6 for ; Mon, 14 Nov 2022 14:28:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AD9B9F800B6 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="aoeGj0v5"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8iDwxPpJ" 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 214441FFD7; Mon, 14 Nov 2022 13:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668432495; 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=NH+4+MkOmQbwNZkGLgk/Tk5Bk1no3ZLIjz0xmPZptr0=; b=aoeGj0v5VpbCVOOM5LF+MYzO8NqBo5E8XGXVamnXnP/anZ7qxZMaO70Qb17boDn55pdWTg jZUB1KCddGlTrgZtdo1Wd2TKfYfI4/MGoheA4/J7ZrCdGcI+qhJwCWz9PASJpLkCZ8fgUn JSEbH/m3R41C6YjLP+/cuxp6PL9GfEA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668432495; 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=NH+4+MkOmQbwNZkGLgk/Tk5Bk1no3ZLIjz0xmPZptr0=; b=8iDwxPpJzyf7yqzCbDERc7NkE0EriGza4ZrBROsoAowM9pYIKNqeZ1+/Ys4f6tqv014nmQ BcbyZqxZaGrcPVAA== 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 E90C313A8C; Mon, 14 Nov 2022 13:28:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ULYcOG5CcmM1SAAAMHmgww (envelope-from ); Mon, 14 Nov 2022 13:28:14 +0000 Date: Mon, 14 Nov 2022 14:28:14 +0100 Message-ID: <871qq54qdt.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: <5b79c60d-0db1-b9e3-fdd4-f320c8f075aa@intel.com> References: <20221114113729.1022905-1-cezary.rojewski@intel.com> <20221114113729.1022905-2-cezary.rojewski@intel.com> <878rkd4roj.wl-tiwai@suse.de> <874jv14qwx.wl-tiwai@suse.de> <5b79c60d-0db1-b9e3-fdd4-f320c8f075aa@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 14:25:31 +0100, Cezary Rojewski wrote: > > On 2022-11-14 2:16 PM, Takashi Iwai wrote: > > On Mon, 14 Nov 2022 14:00:12 +0100, > > Takashi Iwai wrote: > >> On Mon, 14 Nov 2022 12:37:28 +0100, > >> Cezary Rojewski wrote: > > ... > > >>> @@ -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. > > Thanks for paying attention to detail, Takashi. > > > Correction: when it's a non-atomic stream, that doesn't matter, both > > are identical. > > In regard to the point found above, that's precisely why I decided to > use variant with shorten name. Matter of taste I guess. Can switch to > _irq() if you believe it's the correct approach. It's fine in both ways. For the snd_pcm_stream_lock(), maybe worth to put a comment, though. thanks, Takashi