Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the header in a memory window? How does this work if the memory is no longer powered?

It feels like we actually do need to preserve the use of the msg/msg_ext bits precisely for this case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart msg->msg_data is dynamic allocated msg->msg_data = devm_kzalloc(sdev->dev, PAGE_SIZE, GFP_KERNEL);. I think it is not in a memory window.

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;
Expand Down