From patchwork Tue Apr 26 17:17:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 12827614 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 4E5BEC433EF for ; Tue, 26 Apr 2022 17:21:54 +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 8656C18EA; Tue, 26 Apr 2022 19:21:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8656C18EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650993712; bh=UTQU6BdBg7+Z5lLAa9KNocLNRL6+9S0jp1rVPX++10U=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XAOldeOUCIOvGhOJUbh3sth5kcyNyWPyA1praqVMdSZB8b7Z78lWMEYZTi5BLv+/D Xc7/43ryFRE8+w/OnYQKdnDFf6oMUkxy/e/qd+DkKYlf0Paz8UF7NfzsCoD/MPrjmc U9kEo4LRmbA5tMP1pLewV126NdSfEzfLQX1cuRKI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46308F8053C; Tue, 26 Apr 2022 19:18:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94E2EF80536; Tue, 26 Apr 2022 19:18:05 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) (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 F2E82F80516 for ; Tue, 26 Apr 2022 19:17:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F2E82F80516 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NiNjfO4S" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650993480; x=1682529480; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UTQU6BdBg7+Z5lLAa9KNocLNRL6+9S0jp1rVPX++10U=; b=NiNjfO4S9MD73PcD1qHkpe7oSmvqEGLn/nUsTKLeRdt8vRduuJ4ZGoBu ItL8YoeI+xmJz+gJtxQBOuNcWzjbYO9Jo4g1rE9NoyX8ZesH4/XsLPw9I YHP7YPRzcOpvLNnRTYx+ic1cP2uxhyq0vNkGI2HWHaGkWfMZ7Tmq9Erax QLZGCR3lF0jbJVVcJFR056PGpYx7dr3ip+eB5Cn76xlH+cqyUl3qMVQJ1 JBqmMBY2o7WLiTLTI/KuchSFIG23VXKeB/rmUi78L1GMhh9Vq/hsWxaxR EQb2I7F1KvS0z86itapNytBfenUW0B/tLVgdiFr1dz3hswpt5WBZIxXhb A==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="326150585" X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="326150585" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 10:17:49 -0700 X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="558431189" Received: from shashinx-mobl.gar.corp.intel.com (HELO rsridh2-mobl1.localdomain) ([10.254.0.53]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 10:17:48 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Subject: [PATCH 02/11] ASoC: SOF: sof-audio: reset route status before freeing widget Date: Tue, 26 Apr 2022 10:17:34 -0700 Message-Id: <20220426171743.171061-3-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220426171743.171061-1-ranjani.sridharan@linux.intel.com> References: <20220426171743.171061-1-ranjani.sridharan@linux.intel.com> MIME-Version: 1.0 Cc: =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Pierre-Louis Bossart , tiwai@suse.com, broonie@kernel.org, Ranjani Sridharan , Bard Liao 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" This is in preparation for IPC4 which requires that the route be reset before the widget is freed. For IPC3, there is nothing more to be done other than setting the route status. So it is OK to be moved before the widget is freed. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/sof/sof-audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index e2ec60887568..1180d6bab33e 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -34,6 +34,9 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) if (--swidget->use_count) return 0; + /* reset route setup status for all routes that contain this widget */ + sof_reset_route_setup_status(sdev, swidget); + /* continue to disable core even if IPC fails */ if (tplg_ops->widget_free) err = tplg_ops->widget_free(sdev, swidget); @@ -50,8 +53,6 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) err = ret; } - /* reset route setup status for all routes that contain this widget */ - sof_reset_route_setup_status(sdev, swidget); swidget->complete = 0; /*