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
21 changes: 21 additions & 0 deletions sound/soc/sof/ipc4-mtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ static void ipc4_mtrace_free(struct snd_sof_dev *sdev)
ipc4_mtrace_disable(sdev);
}

static int sof_ipc4_mtrace_update_pos_all_cores(struct snd_sof_dev *sdev)
Comment thread
plbossart marked this conversation as resolved.
Resolved
{
int i;

for (i = 0; i < sdev->num_cores; i++)
sof_ipc4_mtrace_update_pos(sdev, i);

return 0;
}

int sof_ipc4_mtrace_update_pos(struct snd_sof_dev *sdev, int core)
{
struct sof_mtrace_priv *priv = sdev->fw_trace_data;
Expand Down Expand Up @@ -641,6 +651,16 @@ int sof_ipc4_mtrace_update_pos(struct snd_sof_dev *sdev, int core)
return 0;
}

static void ipc4_mtrace_fw_crashed(struct snd_sof_dev *sdev)
{
/*
* The DSP might not be able to send SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS
* messages anymore, so check the log buffer status on all
* cores and process any pending messages.
*/
sof_ipc4_mtrace_update_pos_all_cores(sdev);
}

static int ipc4_mtrace_resume(struct snd_sof_dev *sdev)
{
return ipc4_mtrace_enable(sdev);
Expand All @@ -654,6 +674,7 @@ static void ipc4_mtrace_suspend(struct snd_sof_dev *sdev, pm_message_t pm_state)
const struct sof_ipc_fw_tracing_ops ipc4_mtrace_ops = {
.init = ipc4_mtrace_init,
.free = ipc4_mtrace_free,
.fw_crashed = ipc4_mtrace_fw_crashed,
.suspend = ipc4_mtrace_suspend,
.resume = ipc4_mtrace_resume,
};