All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org,
	pierre-louis.bossart@linux.intel.com, daniel.baluta@nxp.com,
	AjitKumar.Pandey@amd.com
Cc: alsa-devel@alsa-project.org, ranjani.sridharan@linux.intel.com,
	kai.vehmanen@linux.intel.com
Subject: [PATCH 2/8] ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported
Date: Mon, 16 May 2022 13:47:05 +0300	[thread overview]
Message-ID: <20220516104711.26115-3-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20220516104711.26115-1-peter.ujfalusi@linux.intel.com>

Rename the internal flag to not limit it's use for dma-trace, but to be
used for generic firmware tracing functionality.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/core.c          |  2 +-
 sound/soc/sof/intel/hda-dsp.c |  2 +-
 sound/soc/sof/sof-priv.h      |  4 +++-
 sound/soc/sof/trace.c         | 14 +++++++-------
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 2d12e8bab769..ff636f0e2435 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -250,7 +250,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
 	}
 
 	if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) {
-		sdev->dtrace_is_supported = true;
+		sdev->fw_trace_is_supported = true;
 
 		/* init DMA trace */
 		ret = snd_sof_init_trace(sdev);
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index c068a3f2f6df..000ea906670c 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -432,7 +432,7 @@ static int hda_dsp_set_D0_state(struct snd_sof_dev *sdev,
 		 * when the DSP enters D0I3 while the system is in S0
 		 * for debug purpose.
 		 */
-		if (!sdev->dtrace_is_supported ||
+		if (!sdev->fw_trace_is_supported ||
 		    !hda_enable_trace_D0I3_S0 ||
 		    sdev->system_suspend_target != SOF_SUSPEND_NONE)
 			flags = HDA_PM_NO_DMA_TRACE;
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index a7ffb6ecf332..f1cbd2b0d1c9 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -546,13 +546,15 @@ struct snd_sof_dev {
 	int ipc_timeout;
 	int boot_timeout;
 
+	/* firmwre tracing */
+	bool fw_trace_is_supported; /* set with Kconfig or module parameter */
+
 	/* DMA for Trace */
 	struct snd_dma_buffer dmatb;
 	struct snd_dma_buffer dmatp;
 	int dma_trace_pages;
 	wait_queue_head_t trace_sleep;
 	u32 host_offset;
-	bool dtrace_is_supported; /* set with Kconfig or module parameter */
 	bool dtrace_error;
 	bool dtrace_draining;
 	enum sof_dtrace_state dtrace_state;
diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c
index 5d171bf8a5ea..c5cc78c1958f 100644
--- a/sound/soc/sof/trace.c
+++ b/sound/soc/sof/trace.c
@@ -392,7 +392,7 @@ static int snd_sof_enable_trace(struct snd_sof_dev *sdev)
 	struct sof_ipc_reply ipc_reply;
 	int ret;
 
-	if (!sdev->dtrace_is_supported)
+	if (!sdev->fw_trace_is_supported)
 		return 0;
 
 	if (sdev->dtrace_state == SOF_DTRACE_ENABLED || !sdev->dma_trace_pages)
@@ -459,9 +459,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
 
 	/* dtrace is only supported with SOF_IPC */
 	if (sdev->pdata->ipc_type != SOF_IPC)
-		sdev->dtrace_is_supported = false;
+		sdev->fw_trace_is_supported = false;
 
-	if (!sdev->dtrace_is_supported)
+	if (!sdev->fw_trace_is_supported)
 		return 0;
 
 	/* set false before start initialization */
@@ -521,7 +521,7 @@ EXPORT_SYMBOL(snd_sof_init_trace);
 int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
 			     struct sof_ipc_dma_trace_posn *posn)
 {
-	if (!sdev->dtrace_is_supported)
+	if (!sdev->fw_trace_is_supported)
 		return 0;
 
 	if (sdev->dtrace_state == SOF_DTRACE_ENABLED &&
@@ -541,7 +541,7 @@ int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
 /* an error has occurred within the DSP that prevents further trace */
 void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev)
 {
-	if (!sdev->dtrace_is_supported)
+	if (!sdev->fw_trace_is_supported)
 		return;
 
 	if (sdev->dtrace_state == SOF_DTRACE_ENABLED) {
@@ -559,7 +559,7 @@ static void snd_sof_release_trace(struct snd_sof_dev *sdev, bool only_stop)
 	struct sof_ipc_reply ipc_reply;
 	int ret;
 
-	if (!sdev->dtrace_is_supported || sdev->dtrace_state == SOF_DTRACE_DISABLED)
+	if (!sdev->fw_trace_is_supported || sdev->dtrace_state == SOF_DTRACE_DISABLED)
 		return;
 
 	ret = snd_sof_dma_trace_trigger(sdev, SNDRV_PCM_TRIGGER_STOP);
@@ -611,7 +611,7 @@ EXPORT_SYMBOL(snd_sof_trace_resume);
 
 void snd_sof_free_trace(struct snd_sof_dev *sdev)
 {
-	if (!sdev->dtrace_is_supported)
+	if (!sdev->fw_trace_is_supported)
 		return;
 
 	/* release trace */
-- 
2.36.1


  parent reply	other threads:[~2022-05-16 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 10:47 [PATCH 0/8] ASoC: SOF: Introduce generic (in)firmware tracing infrastructure Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 1/8] ASoC: SOF: Introduce IPC independent ops for firmware tracing support Peter Ujfalusi
2022-05-16 10:47 ` Peter Ujfalusi [this message]
2022-05-16 10:47 ` [PATCH 3/8] ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 4/8] ASoC: SOF: Switch to IPC generic firmware tracing Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 5/8] ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to private Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 6/8] ASoC: SOF: Modify the host trace_init parameter list to include dmab Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 7/8] ASoC: SOF: Introduce opaque storage of private data for firmware tracing Peter Ujfalusi
2022-05-16 10:47 ` [PATCH 8/8] ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from sof_dev Peter Ujfalusi
2022-05-20 16:58 ` [PATCH 0/8] ASoC: SOF: Introduce generic (in)firmware tracing infrastructure 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=20220516104711.26115-3-peter.ujfalusi@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=AjitKumar.Pandey@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@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.