ASoC: SOF: IPC: add ipc dump function
authorPan Xiuli <xiuli.pan@linux.intel.com>
Tue, 30 Apr 2019 23:09:32 +0000 (18:09 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 3 May 2019 06:02:16 +0000 (15:02 +0900)
Dump IPC status when IPC timed out. IPC status is platform specific and
need bind to plaform.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index 437e80a07bc2c4bd41c53280c6beaf225afced35..ba1bb17a8d1e5f86728f04332318cea12539fbf0 100644 (file)
@@ -207,6 +207,7 @@ static int tx_wait_done(struct snd_sof_ipc *ipc, struct snd_sof_ipc_msg *msg,
                dev_err(sdev->dev, "error: ipc timed out for 0x%x size %d\n",
                        hdr->cmd, hdr->size);
                snd_sof_dsp_dbg_dump(ipc->sdev, SOF_DBG_REGS | SOF_DBG_MBOX);
+               snd_sof_ipc_dump(ipc->sdev);
                snd_sof_trace_notify_for_error(ipc->sdev);
                ret = -ETIMEDOUT;
        } else {
index b8e2bf1fee2474b871e80c31d3fd77fcd48d6205..80fc3b374c2b3bd27aa2198813c8c008136f78b0 100644 (file)
@@ -155,6 +155,12 @@ static inline void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags)
                return sof_ops(sdev)->dbg_dump(sdev, flags);
 }
 
+static inline void snd_sof_ipc_dump(struct snd_sof_dev *sdev)
+{
+       if (sof_ops(sdev)->ipc_dump)
+               return sof_ops(sdev)->ipc_dump(sdev);
+}
+
 /* register IO */
 static inline void snd_sof_dsp_write(struct snd_sof_dev *sdev, u32 bar,
                                     u32 offset, u32 value)
index 170adc21ef1753063cba51969ad6986c12099260..1e85d6f9c5c308840c0d91a5bc90bf2c4aea52d7 100644 (file)
@@ -176,6 +176,7 @@ struct snd_sof_dsp_ops {
        int debug_map_count; /* optional */
        void (*dbg_dump)(struct snd_sof_dev *sof_dev,
                         u32 flags); /* optional */
+       void (*ipc_dump)(struct snd_sof_dev *sof_dev); /* optional */
 
        /* host DMA trace initialization */
        int (*trace_init)(struct snd_sof_dev *sdev,