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 E56F7C4332F for ; Fri, 16 Dec 2022 09:08:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4806B1688; Fri, 16 Dec 2022 10:07:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4806B1688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671181701; bh=wuF1t6zWxO1u8aEWfWc2EQqFWHXs/FCOZq2UrnUhyK4=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=FHRXhu0mq2F7mvmf4Wa+C2+C7s4q3AuubVlm9zrrkjxt6QS8o9qsDVQs94kV1StUV LMty1Narjw5JuiT2HHy8VCilKNl9LXjXEB6yw2vLOjRYmSPve+l2IG76GEBlNklRVc T32M8J7MwfWDIxKmVA9p6+/SCn3VzYZyfdUrc6AY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E1D85F804E0; Fri, 16 Dec 2022 10:07:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86F1DF804E2; Fri, 16 Dec 2022 10:07:28 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 A37B1F804D0 for ; Fri, 16 Dec 2022 10:07:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A37B1F804D0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=fR4ume06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671181643; x=1702717643; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=wuF1t6zWxO1u8aEWfWc2EQqFWHXs/FCOZq2UrnUhyK4=; b=fR4ume06I1MI1NvGbNnrjH2BB+wf4J4Y+Ys4v5ICq2Ed+Nun4cwQBWvL 4CzR8pGKzSfSAqsmaVT0nrJtaxEFNj4WIyHVu43XsRTynbu4NXxSnLviM hdHRg2lal5VrCBDbLBSmalC6X1+FhszVz9MnwbJxq72w+oWhwrBumilqs 3do+x7MJCuV9JYkJS5MW0bCIXSTKOeNzzVq4UA/Qnd0WSCa7JXIPKsH0v dhoTNOMzzoswwT9hDWkG2pdL8k+a2eK8B5hw9rQU558pvpR/uTz4mATZk KSWtXkAufHL3ByvIQ7uhehxVvCSDXkXyVSWrqim6gX+9b06bl7Rm0HvG3 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="320808165" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="320808165" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 01:07:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="599879898" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="599879898" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.99.16.144]) ([10.99.16.144]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 01:06:59 -0800 Message-ID: Date: Fri, 16 Dec 2022 10:06:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 2/3] ASoC: SOF: pm: Always tear down pipelines before DSP suspend To: Ranjani Sridharan , alsa-devel@alsa-project.org References: <20221215185347.1457541-1-ranjani.sridharan@linux.intel.com> <20221215185347.1457541-3-ranjani.sridharan@linux.intel.com> Content-Language: en-US From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= In-Reply-To: <20221215185347.1457541-3-ranjani.sridharan@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: tiwai@suse.de, =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Pierre-Louis Bossart , broonie@kernel.org, Curtis Malainey , Bard Liao Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 12/15/2022 7:53 PM, Ranjani Sridharan wrote: > When the DSP is suspended while the firmware is in the crashed state, we > skip tearing down the pipelines. This means that the widget reference > counts will not get to reset to 0 before suspend. This will lead to > errors with resuming audio after system resume. To fix this, invoke the > tear_down_all_pipelines op before skipping to DSP suspend. > > Signed-off-by: Ranjani Sridharan > Reviewed-by: Curtis Malainey > Reviewed-by: Pierre-Louis Bossart > Reviewed-by: Bard Liao > Reviewed-by: Péter Ujfalusi > --- > sound/soc/sof/pm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c > index 5f88c4a01fa3..f153881db189 100644 > --- a/sound/soc/sof/pm.c > +++ b/sound/soc/sof/pm.c > @@ -192,6 +192,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) > if (runtime_suspend && !sof_ops(sdev)->runtime_suspend) > return 0; > > + if (tplg_ops && tplg_ops->tear_down_all_pipelines) > + tplg_ops->tear_down_all_pipelines(sdev, false); > + > if (sdev->fw_state != SOF_FW_BOOT_COMPLETE) > goto suspend; > Can tplg_ops even be null? Rest of SOF code seems to skip this check and only check for callback presence. Also won't tearing down pipelines few lines later become unnecessary then? https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/sof/pm.c?id=a12a383e59ce486abd719b6bda33c353a3b385e7#n220