From d2456f61097c0cdbcf6ee8c5e30f84b91157dd2b Mon Sep 17 00:00:00 2001 From: Bard liao Date: Thu, 14 Feb 2019 03:17:20 +0800 Subject: [PATCH] ASoC: SOF: intel: don't read CTX_SAVE reply The memory windows are powered off before sending IPC reply back to the host, so the host should not try to read the mailbox for CTX_SAVE reply. Signed-off-by: Bard liao --- sound/soc/sof/intel/hda-ipc.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-ipc.c b/sound/soc/sof/intel/hda-ipc.c index 38dae0ddbfa43f..589264524f08c5 100644 --- a/sound/soc/sof/intel/hda-ipc.c +++ b/sound/soc/sof/intel/hda-ipc.c @@ -86,11 +86,24 @@ int hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) { struct sof_ipc_reply reply; + struct sof_ipc_cmd_hdr *hdr; int ret = 0; u32 size; - /* get IPC reply from DSP in the mailbox */ - sof_mailbox_read(sdev, sdev->host_box.offset, &reply, sizeof(reply)); + hdr = (struct sof_ipc_cmd_hdr *)msg->msg_data; + if (hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE)) { + /* + * memory windows are powered off before sending IPC reply, + * so we can't read the mailbox for CTX_SAVE reply. + */ + reply.error = 0; + reply.hdr.cmd = SOF_IPC_GLB_REPLY; + reply.hdr.size = sizeof(reply); + } else { + /* get IPC reply from DSP in the mailbox */ + sof_mailbox_read(sdev, sdev->host_box.offset, &reply, + sizeof(reply)); + } if (reply.error < 0) { size = sizeof(reply); ret = reply.error;