Skip to content

Possible missed trace logs at the beginning #3448

@dbaluta

Description

@dbaluta

Looking at the code in snd_sof_init_trace_ipc we have:

int snd_sof_init_trace_ipc(struct snd_sof_dev *sdev)
{
/* .. */
       /* send IPC to the DSP */
       ret = sof_ipc_tx_message(sdev->ipc,
                                params.hdr.cmd, &params, sizeof(params),
                               &ipc_reply, sizeof(ipc_reply));

<<<HERE>>
       ret = snd_sof_dma_trace_trigger(sdev, SNDRV_PCM_TRIGGER_START);
       sdev->dtrace_is_enabled = true;
}

Then at snd_sof_trace_update_pos we have:

int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
»       »       »            struct sof_ipc_dma_trace_posn *posn)
{

        if (sdev->dtrace_is_enabled && sdev->host_offset != posn->host_offset) {                                                                                                                                   
               sdev->host_offset = posn->host_offset;
              wake_up(&sdev->trace_sleep);
        }

It is possible that the reply for SOF_IPC_TRACE_DMA_PARAMS_EXT to arrive at the marker <<<HERE>> so, snd_sof_trace_update_pos will miss the DMA trace position update because dtrace_is_enabled is set too late.

This happens all the time on i.MX with the result that we cannot see the DMA trace boot logs until later when some other log messages are generated.

Is this a known issue on other platforms?

Cc: @marc-hb

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions