From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC7AB14C5B0; Tue, 23 Jul 2024 18:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721759623; cv=none; b=hZBUNxIgALi6jtINybdwrhsS1PJZEU7ocS+MQ63tuL08K7bHH+1oeGUqkzqdoEpb6b8KDLG2nmz+cEUvuzy7tJfDhmHPoAUiMj8jCtU/E65yHQJtcIMkX6gy6mxKVHCXM/WuaZ1xNslQL5IDYgTMFHX6ocVM0Ct8CVNIM7b0UI4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721759623; c=relaxed/simple; bh=WdhNzHJW1WBGPSPLz3TqJbrODUOAP+mKVAvkC36MQNY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQGdSK60yzSQsWz4fn9A6msMxWhM3CFrn6hb/FtG/QvScLtaBmAmiNxlPtxYvVzYSloztX/ZMvt2Uo4QChOKFlCKzjqfXhyKR5OOQSu4qDgmdXCIO0/DtXGLqjWxhzN1F2qkSGbCNmR1ynwBqdXdMs4HuT+gTvispapvAGku3gQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lUiE4qm/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lUiE4qm/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F410C4AF0B; Tue, 23 Jul 2024 18:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721759623; bh=WdhNzHJW1WBGPSPLz3TqJbrODUOAP+mKVAvkC36MQNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lUiE4qm//tWAXe3mGB+yz0E9mtVeYXDFhp1P1gjdQM/Ft13QJyr3WcIgEY2q496m0 4oeUkoHNVu/12td8EpKoHJvs+d7Nb5VfDz0XjBc3Dg81aUQV/4vAHPGl7Ub/qhfP6n pmZthK420Lcw2Tc0toueOm+J9+0WO9/XEnYdCBsI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Ujfalusi , Pierre-Louis Bossart , Kai Vehmanen , Ranjani Sridharan , Mark Brown , Sasha Levin Subject: [PATCH 6.6 073/129] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback Date: Tue, 23 Jul 2024 20:23:41 +0200 Message-ID: <20240723180407.604604467@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240723180404.759900207@linuxfoundation.org> References: <20240723180404.759900207@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Ujfalusi [ Upstream commit 6f2a43e3d14f6e31a3b041a1043195d02c54d615 ] If the ipc_prepare() callback fails for a module instance, on error rewind we must skip the ipc_unprepare() call for ones that has positive use count. The positive use count means that the module instance is in active use, it cannot be unprepared. The issue affects capture direction paths with branches (single dai with multiple PCMs), the affected widgets are in the shared part of the paths. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20240612121203.15468-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 77cc64ac71131..5162625834725 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -488,7 +488,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget if (ret < 0) { /* unprepare the source widget */ if (widget_ops[widget->id].ipc_unprepare && - swidget && swidget->prepared) { + swidget && swidget->prepared && swidget->use_count == 0) { widget_ops[widget->id].ipc_unprepare(swidget); swidget->prepared = false; } -- 2.43.0