Skip to content

Commit

Permalink
dma-trace: send ipc msg after update host pointer
Browse files Browse the repository at this point in the history
before copy section to host, the hist pointer should

be updated.

otherwise, there are some left data in dma buffer and

host don't know.

Signed-off-by: Allen-KH Cheng <[email protected]>
  • Loading branch information
kuanhsuncheng authored and lgirdwood committed Sep 17, 2021
1 parent 9fadef7 commit ed5d2fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/ipc/dma-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
int32_t host_offset, void *local_ptr, int32_t size)
{
struct dma_trace_data *dmat = dma_trace_data_get();
struct dma_sg_config config;
struct dma_sg_elem *host_sg_elem;
struct dma_sg_elem local_sg_elem;
Expand Down Expand Up @@ -122,8 +121,6 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
if (err < 0)
return err;

ipc_msg_send(dmat->msg, &dmat->posn, false);

/* bytes copied */
return local_sg_elem.size;
}
Expand Down
2 changes: 2 additions & 0 deletions src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ static enum task_state trace_work(void *data)
if (buffer->r_ptr >= buffer->end_addr)
buffer->r_ptr = (char *)buffer->r_ptr - DMA_TRACE_LOCAL_SIZE;

ipc_msg_send(d->msg, &d->posn, false);

out:
spin_lock_irq(&d->lock, flags);

Expand Down

0 comments on commit ed5d2fe

Please sign in to comment.