From b59106649fb8f38311d121dc638ae2e7e75a4796 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 2 Apr 2019 17:22:02 -0700 Subject: [PATCH] ASoC: SOF: intel: ipc: don't read mailbox for CTX_SAVE If the reply from the DSP is for a CTX_SAVE ipc, don't read the mailbox, just return after setting the reply attributes. Signed-off-by: Ranjani Sridharan --- sound/soc/sof/intel/hda-ipc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/sof/intel/hda-ipc.c b/sound/soc/sof/intel/hda-ipc.c index e742fcd3dac2fe..d0e858045e54d5 100644 --- a/sound/soc/sof/intel/hda-ipc.c +++ b/sound/soc/sof/intel/hda-ipc.c @@ -86,12 +86,13 @@ void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) 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)); + goto out; } + /* get IPC reply from DSP in the mailbox */ + sof_mailbox_read(sdev, sdev->host_box.offset, &reply, + sizeof(reply)); + if (reply.error < 0) { memcpy(msg->reply_data, &reply, sizeof(reply)); ret = reply.error; @@ -109,6 +110,7 @@ void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) msg->reply_data, msg->reply_size); } +out: msg->reply_error = ret; spin_unlock_irqrestore(&sdev->ipc_lock, flags);