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 2A834C32793 for ; Wed, 18 Jan 2023 10:14:24 +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 E8A7A3C06; Wed, 18 Jan 2023 11:13:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E8A7A3C06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1674036862; bh=ZaTfT/TzpnziENBD0LGWp+bLkuEkhKUfAkz7DfPjrrw=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=JpL84YKjh4RQtDkBu2sR56wlLq+DD2TmbH3odJwcMuSDlJf9kTjJwmRIBsiYbrTkw SQOYSIWh256qSwEfSqnsAeGglf3F26chIkHxD9vRGbguX2TdbTqGyKRBtXcmOZ+oaI 9fx1NIbBhfc6QppdtPGcAp0l9BCx17a2aIJjcbD4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4FA61F8024D; Wed, 18 Jan 2023 11:13:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7E295F80482; Wed, 18 Jan 2023 11:13:04 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 27A19F8026D for ; Wed, 18 Jan 2023 11:13:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 27A19F8026D 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=I49RcDmz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674036782; x=1705572782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZaTfT/TzpnziENBD0LGWp+bLkuEkhKUfAkz7DfPjrrw=; b=I49RcDmzl/qHH3KXmdYpRl4omQsRJDZASpgWApCko7x2BcU6kjopk9DN r5Lp5U40CyFlC/t8mle4dcPtyG5/55y7yUofjZSotvFJh1RZJ8l9PbLAm ny/ChiL3S+1gwxqI6oTDtsazmgPa7r+gFfkCG//wvjAVOD08gTvm3QE14 rUwiWPVmAbg2yQ+AZPdwAl/jBhpz1gzXKFIJsHcjB30O2ngHfUQHjRITy 1v935LxAsyr4G0c/GhGbCRu0CIeTuzH314odCECu9IT1jvJ0rsjJ4X86E cd/5JOU94iOC2SSQY5fW63PuNBIrfnW0rzPG73E0or/1iceddoKHbWGV6 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="304630440" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="304630440" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 02:12:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="661653795" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="661653795" Received: from kevinkeo-mobl.ger.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.252.26.150]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 02:12:53 -0800 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH v3 1/3] ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0 Date: Wed, 18 Jan 2023 12:12:53 +0200 Message-Id: <20230118101255.29139-2-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118101255.29139-1-peter.ujfalusi@linux.intel.com> References: <20230118101255.29139-1-peter.ujfalusi@linux.intel.com> MIME-Version: 1.0 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: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com, pierre-louis.bossart@linux.intel.com, rander.wang@intel.com, ranjani.sridharan@linux.intel.com, yung-chuan.liao@linux.intel.com, angelogioacchino.delregno@collabora.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Bard Liao We should unprepare the widget if its use_count = 1. Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines") Cc: # 6.1 Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Peter Ujfalusi --- sound/soc/sof/sof-audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 7306a2649857..e52ef62ce7a3 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -272,7 +272,7 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg struct snd_soc_dapm_path *p; /* return if the widget is in use or if it is already unprepared */ - if (!swidget->prepared || swidget->use_count > 1) + if (!swidget->prepared || swidget->use_count > 0) return; if (widget_ops[widget->id].ipc_unprepare) -- 2.39.0