All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Rander Wang <rander.wang@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 3/8] ASoC: SOF: core: Free the firmware trace before calling snd_sof_shutdown()
Date: Fri, 16 Jun 2023 12:00:34 +0200	[thread overview]
Message-ID: <20230616100039.378150-4-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20230616100039.378150-1-pierre-louis.bossart@linux.intel.com>

From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

The shutdown is called on reboot/shutdown of the machine.
At this point the firmware tracing cannot be used anymore but in case of
IPC3 it is using and keeping a DMA channel active (dtrace).

For Tiger Lake platforms we have a quirk in place to fix rare reboot issues
when a DMA was active before rebooting the system.
If the tracing is enabled this quirk will be always used and a print
appears on the kernel log which might be misleading or not even correct.

Release the fw tracing before executing the shutdown to make sure that this
known DMA user is cleared away.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 9a9d82220fd0..30db685cc5f4 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -504,8 +504,10 @@ int snd_sof_device_shutdown(struct device *dev)
 	if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
 		cancel_work_sync(&sdev->probe_work);
 
-	if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
+	if (sdev->fw_state == SOF_FW_BOOT_COMPLETE) {
+		sof_fw_trace_free(sdev);
 		return snd_sof_shutdown(sdev);
+	}
 
 	return 0;
 }
-- 
2.37.2


  parent reply	other threads:[~2023-06-16 10:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 10:00 [PATCH 0/8] ASoC: SOF: misc updates for 6.5 Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 1/8] ASoC: SOF: sof-audio: add is_virtual_widget helper Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 2/8] ASoC: SOF: sof-audio: test virtual widget in sof_walk_widgets_in_order Pierre-Louis Bossart
2023-06-16 10:00 ` Pierre-Louis Bossart [this message]
2023-06-16 10:00 ` [PATCH 4/8] ASoC: SOF: Add new sof_debug flag to request message payload dump Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 5/8] ASoC: SOF: ipc3: Dump IPC message payload Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 6/8] ASoC: SOF: ipc4: Switch to use the sof_debug:bit11 to dump " Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 7/8] ASoC: SOF: pm: Remove duplicated code in sof_suspend Pierre-Louis Bossart
2023-06-16 10:00 ` [PATCH 8/8] ASoC: SOF: Intel: mtl: setup primary core info on MeteorLake platform Pierre-Louis Bossart
2023-06-16 16:16 ` [PATCH 0/8] ASoC: SOF: misc updates for 6.5 Mark Brown

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=20230616100039.378150-4-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.