[Sound-open-firmware] [PATCH 6/7] ASoC: SOF: Add exception memory window support for BDW

Xiuli Pan xiuli.pan at linux.intel.com
Wed Mar 21 09:38:58 CET 2018


From: Pan Xiuli <xiuli.pan at linux.intel.com>

Use memory window to handle DSP panic.

Signed-off-by: Pan Xiuli <xiuli.pan at linux.intel.com>

---
Test with:
Mininow max rt5651 and GP-MRB nocodec and CNL nocodec
SOF 1.1-stable: ffd9093267aa8d3deeffeb09b73c8b0789ad4071
SOF-Tool 1.1-stable: cc91c73aa3e91eea35abdeb76d578b97f718feff
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
4881a4bd906f8b52bebd209b88ff920005550d53
---
 sound/soc/sof/hw-bdw.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sof/hw-bdw.c b/sound/soc/sof/hw-bdw.c
index c50e4ca..d2de722 100644
--- a/sound/soc/sof/hw-bdw.c
+++ b/sound/soc/sof/hw-bdw.c
@@ -296,12 +296,10 @@ static void bdw_get_registers(struct snd_sof_dev *sdev,
 			      u32 *stack, size_t stack_words)
 {
 	/* first read regsisters */
-	bdw_mailbox_read(sdev, sdev->host_box.offset + EXCEPT_OFFSET,
-			 xoops, sizeof(*xoops));
+	bdw_mailbox_read(sdev, sdev->dsp_oops_offset, xoops, sizeof(*xoops));
 
 	/* the get the stack */
-	bdw_mailbox_read(sdev, sdev->host_box.offset + EXCEPT_OFFSET +
-			 sizeof(*xoops), stack,
+	bdw_mailbox_read(sdev, sdev->dsp_oops_offset + sizeof(*xoops), stack,
 			 stack_words * sizeof(u32));
 }
 
@@ -376,7 +374,14 @@ static irqreturn_t bdw_irq_thread(int irq, void *context)
 	/* new message from DSP */
 	if (ipcd & SHIM_IPCD_BUSY) {
 		/* Handle messages from DSP Core */
-		snd_sof_ipc_msgs_rx(sdev);
+		if ((ipcd & SOF_IPC_PANIC_MAGIC_MASK) == SOF_IPC_PANIC_MAGIC) {
+			dev_err(sdev->dev, "error : DSP panic!\n");
+			snd_sof_dsp_cmd_done(sdev);
+			snd_sof_dsp_dbg_dump(sdev, SOF_DBG_REGS | SOF_DBG_MBOX);
+			snd_sof_trace_notify_for_error(sdev);
+		} else {
+			snd_sof_ipc_msgs_rx(sdev);
+		}
 	}
 
 	/* continue to send any remaining messages... */
@@ -450,6 +455,13 @@ static void bdw_get_windows(struct snd_sof_dev *sdev)
 						    elem->offset + MBOX_OFFSET,
 						    elem->size, "regs");
 			break;
+		case SOF_IPC_REGION_EXCEPTION:
+			sdev->dsp_oops_offset = elem->offset + MBOX_OFFSET;
+			snd_sof_debugfs_create_item(sdev,
+						    sdev->bar[BDW_DSP_BAR] +
+						    elem->offset + MBOX_OFFSET,
+						    elem->size, "exception");
+			break;
 		default:
 			dev_err(sdev->dev, "error: get illegal window info\n");
 			return;
-- 
2.7.4



More information about the Sound-open-firmware mailing list