Blob Blame History Raw
From e6ff3db9efe96a9c3cd8b0c33744f259c1928a42 Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Date: Wed, 6 Oct 2021 14:06:38 +0300
Subject: [PATCH] ASoC: SOF: ipc: Re-enable dumps after successful IPC tx
Git-commit: e6ff3db9efe96a9c3cd8b0c33744f259c1928a42
Patch-mainline: v5.16-rc1
References: jsc#PED-850

The dumps are silenced after an IPC tx timeout by default.
The IPC timeout can indicate severe error (firmware crash) or in some cases
it is less devastating and the firmware remains operational, the timeout
was due to a scheduling spike or other anomaly.

In any case consequent IPC timeouts will not print dumps but if any IPC do
succeed than we should re-enable the dumps to print dumps the next time
a timeout might happen.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 sound/soc/sof/ipc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c
index 53593df95155..5c698fa662f4 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -267,6 +267,12 @@ static int tx_wait_done(struct snd_sof_ipc *ipc, struct snd_sof_ipc_msg *msg,
 				memcpy(reply_data, msg->reply_data,
 				       msg->reply_size);
 		}
+
+		/* re-enable dumps after successful IPC tx */
+		if (sdev->ipc_dump_printed) {
+			sdev->dbg_dump_printed = false;
+			sdev->ipc_dump_printed = false;
+		}
 	}
 
 	return ret;
-- 
2.35.3