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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF7B7C636CD for ; Tue, 7 Feb 2023 13:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232098AbjBGNEz (ORCPT ); Tue, 7 Feb 2023 08:04:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232099AbjBGNEp (ORCPT ); Tue, 7 Feb 2023 08:04:45 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F683A598 for ; Tue, 7 Feb 2023 05:04:28 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 32E4661407 for ; Tue, 7 Feb 2023 13:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 453C3C433D2; Tue, 7 Feb 2023 13:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675775067; bh=6pjUSuhAj9MlD6LYSGoLgPVu1Q8/WKJinH8jLawIQSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGrVnL+CEndWRnz0tiyhajk3X5lp+z3dKHxUP2+jHB/046kDNL5Vs6L9v00QrUtvC F0akicXM5rJjR/Fs6xP65H+TKm0iByEvRycDqYpRFpN7jcRKaIyrbdqlK8iiWmzLmw JqE8AghIAnqK2CXnaZcEA7ys5rORwbGlaUQAycd0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bard Liao , Ranjani Sridharan , Pierre-Louis Bossart , Rander Wang , Peter Ujfalusi , Mark Brown Subject: [PATCH 6.1 127/208] ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0 Date: Tue, 7 Feb 2023 13:56:21 +0100 Message-Id: <20230207125640.163465376@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207125634.292109991@linuxfoundation.org> References: <20230207125634.292109991@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bard Liao commit 7d2a67e02549c4b1feaac4d8b4151bf46424a047 upstream. 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 Link: https://lore.kernel.org/r/20230118101255.29139-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- 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.1