Skip to content

trace: fix dma trace with repeated data bug on APL&CNL - #71

Merged
lgirdwood merged 1 commit into
thesofproject:masterfrom
RanderWang:dmatrace
Jul 9, 2018
Merged

lgirdwood merged 1 commit into
thesofproject:masterfrom
RanderWang:dmatrace

Conversation

@RanderWang

@RanderWang RanderWang commented Jul 9, 2018 •

Copy link
Copy Markdown
Collaborator

It is caused by dma trace buffer overflow in FW. There are too many
trace events that the dma trace buffer can’t hold them, And this makes
buffer in chaos.

It is assumed that the trace msg is transferred to host when it is full,
and the occupied memory can be reused. But it is not always true. The dma
trace buffer is used as a ring buffer. In warp case, both tail and head
of the buffer are used, only the tail of buffer is transferred to host and
released. It is because GPDMA only support successive memory mode. So it
is need to be done with two dma calls. Because trace is for debugging
and to occupy the cpu usage as little as possible, only the first dma
transfer is done and the second one is scheduled next time. So only part
of dma trace buffer is released. On APL & CNL, dma gateway is used for dma
trace and it supports wrap mode transfer. So the algorithm can be refined
for dma gateway

Now add a function to do the job for different HW feature. For GPDMA, no
change is made currently, but later it would be refined to support link
list mode. For platform with dma gateway, transferring trace
msg with one dma call.

Test it on BYT, APL

Signed-off-by: Rander Wang rander.wang@linux.intel.com

It is caused by dma trace buffer overflow in FW. There are too many
trace events that the dma trace buffer can’t hold them, And this makes
buffer in chaos.

It is assumed that the trace msg is transferred to host when it is full,
and the occupied memory can be reused. But it is not always true. The dma
trace buffer is used as a ring buffer. In warp case, both tail and head
of the buffer are used, only the tail of buffer is transferred to host and
released. It is because GPDMA on BYT only support successive memory mode.
So it is need to be done with two dma calls. Because trace is for debugging
and to occupy the cpu usage as little as possible, only the first dma
transfer is done and the second one is scheduled next time. So only part
of dma trace buffer is released. On APL & CNL, dma gateway is used for dma
trace and it supports wrap mode transfer. So the algorithm can be refined
for dma gateway

Now add a function to do the job for different HW feature. For GPDMA, no
change is made currently, but later it would be refined to support link
list mode. For platform with dma gateway, transferring trace msg with one
dma call.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
@lgirdwood
lgirdwood merged commit b51fefb into thesofproject:master Jul 9, 2018
@keqiaozhang

Copy link
Copy Markdown
Collaborator

This PR will cause IPC timeout after system is booted. bug #79

ryans-lee pushed a commit to ryans-lee/sof that referenced this pull request Jul 9, 2020
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants