Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Sasha Levin" <sashal@kernel.org>,
	alsa-devel@alsa-project.org, lgirdwood@gmail.com,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>,
	tiwai@suse.com,
	"Ranjani Sridharan" <ranjani.sridharan@linux.intel.com>,
	daniel.baluta@nxp.com,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Curtis Malainey" <cujomalainey@chromium.org>,
	"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	sound-open-firmware@alsa-project.org
Subject: [PATCH AUTOSEL 6.1 03/53] ASoC: SOF: pm: Always tear down pipelines before DSP suspend
Date: Mon, 16 Jan 2023 09:01:03 -0500	[thread overview]
Message-ID: <20230116140154.114951-3-sashal@kernel.org> (raw)
In-Reply-To: <20230116140154.114951-1-sashal@kernel.org>

From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

[ Upstream commit d185e0689abc98ef55fb7a7d75aa0c48a0ed5838 ]

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 <ranjani.sridharan@linux.intel.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221220125629.8469-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/sof/pm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index 5f88c4a01fa3..8722bbd7fd3d 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;
 
@@ -216,9 +219,6 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
 		goto suspend;
 	}
 
-	if (tplg_ops->tear_down_all_pipelines)
-		tplg_ops->tear_down_all_pipelines(sdev, false);
-
 	/* suspend DMA trace */
 	sof_fw_trace_suspend(sdev, pm_state);
 
-- 
2.35.1


  parent reply	other threads:[~2023-01-16 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230116140154.114951-1-sashal@kernel.org>
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 02/53] ASoC: SOF: pm: Set target state earlier Sasha Levin
2023-01-16 14:01 ` Sasha Levin [this message]
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 04/53] ASoC: SOF: Add FW state to debugfs Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 05/53] ASoC: amd: yc: Add Razer Blade 14 2022 into DMI table Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 09/53] ASoC: mediatek: mt8186: support rt5682s_max98360 Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 10/53] ASoC: mediatek: mt8186: Add machine support for max98357a Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 11/53] ASoC: amd: yc: Add ASUS M5402RA into DMI table Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 12/53] ASoC: support machine driver with max98360 Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 15/53] ASoC: fsl_micfil: Correct the number of steps on SX controls Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 32/53] ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 33/53] ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230116140154.114951-3-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=daniel.baluta@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox