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 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 EB96BC4332F for ; Thu, 10 Nov 2022 16:37:46 +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 D12611657; Thu, 10 Nov 2022 17:36:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D12611657 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668098264; bh=aFhD3qJO4lPjE8XyhAyJhgK7gl4+zvWnrMAgjLDvafo=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=snvVI9VjdnbHDnJd1bYOmg+8fcU+AYDxE/NGVuWApaDMqhFZpC78FZ/lVA3fohv7a i93a+g24s47x44qbagiK5ZHvpwnEQ6qVI4EZWXtPu7Z/L/LrhDuPX/tzrlsKJSzB+/ T6KzSyHrsV94VETiGCThRMZnaZI8ptWFG92asg2g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 75E0CF80163; Thu, 10 Nov 2022 17:36:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86FFAF80163; Thu, 10 Nov 2022 17:36:53 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DC674F80162 for ; Thu, 10 Nov 2022 17:36:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DC674F80162 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BuyFFU5p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668098208; x=1699634208; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=aFhD3qJO4lPjE8XyhAyJhgK7gl4+zvWnrMAgjLDvafo=; b=BuyFFU5pnvrB4wixfx6ikOUTo1SEB1EDAlYEn5xEuCkZ4sEztNh0AKHY NibVewBgPk4YA/1Jj7shm3dfMJLU4bMizlpyJ+Wr6WeJz1SY+Hu70hJNo wPdgn4OniKWzi1EfNPRHszQKiVabYmjGDHFlubFelTVVcdjsbi5YKUh8l 4D9Q4WmYukitscQwM+wIDANGGI782q+g1XwsDyGcSDmQovCCpQdQAxoMR OI6Hlrz3BHSMxdLDNgRbRmDgDLim5ZeoHZlqIHH2N/750uACjRk7CYBLM JQKN2xWxL44uWtDcOf+JuRjdoUZPFYyv8TeiA+ClR+iKpfbS8UW3PkR+L A==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="308982413" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="308982413" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 08:36:21 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="762342220" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="762342220" Received: from byrons1x-mobl.amr.corp.intel.com (HELO [10.212.85.58]) ([10.212.85.58]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 08:36:20 -0800 Message-ID: <65f24445-11ed-cd36-4fd2-e326bf877f54@linux.intel.com> Date: Thu, 10 Nov 2022 10:36:19 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.2.2 Subject: Re: [PATCH 2/2] ASoC: Intel: avs: Disconnect substream if suspend or resume fails Content-Language: en-US To: Cezary Rojewski , alsa-devel@alsa-project.org, broonie@kernel.org References: <20221110141330.740916-1-cezary.rojewski@intel.com> <20221110141330.740916-3-cezary.rojewski@intel.com> <6f86718b-5d96-3e73-bfc0-321288e2232c@linux.intel.com> <8cc5ecbe-8112-2359-aa90-1d5d1b50d89c@intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: hdegoede@redhat.com, tiwai@suse.com, 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 11/10/22 10:29, Cezary Rojewski wrote: > On 2022-11-10 5:18 PM, Pierre-Louis Bossart wrote: >> On 11/10/22 10:06, Cezary Rojewski wrote: > >>> Unless something new has been added/updated, there is no runtime->state >>> field available. All the PCM code works with runtime->status->state. >> >> cd sound/ >> >> git grep -c 'runtime->state' >> core/compress_offload.c:27 > > ... > >> git grep -c 'status->state' >> core/pcm_compat.c:2 >> core/pcm_native.c:4 > > I see now, thanks. Commit from late September "ALSA: pcm: Avoid > reference to status->state" add a new field. Will update the code to use > __snd_pcm_set_state() instead. > > My base did not have it yet. Right, it's relatively recent, and my point is that the helper does use stream locking when testing the same state you modify. Maybe that's a red herring but I thought I'd ask. static void snd_pcm_set_state(struct snd_pcm_substream *substream, snd_pcm_state_t state) { snd_pcm_stream_lock_irq(substream); if (substream->runtime->state != SNDRV_PCM_STATE_DISCONNECTED) __snd_pcm_set_state(substream->runtime, state); snd_pcm_stream_unlock_irq(substream); }