dma-trace: send ipc msg after update host pointer

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 <allen-kh.cheng@mediatek.com>
This commit is contained in:
Allen-KH Cheng 2021-09-14 21:13:45 +08:00 committed by Liam Girdwood
parent 9fadef789e
commit ed5d2feaf6
2 changed files with 2 additions and 3 deletions

View File

@ -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, 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) 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_config config;
struct dma_sg_elem *host_sg_elem; struct dma_sg_elem *host_sg_elem;
struct dma_sg_elem local_sg_elem; struct dma_sg_elem local_sg_elem;
@ -122,8 +121,6 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
if (err < 0) if (err < 0)
return err; return err;
ipc_msg_send(dmat->msg, &dmat->posn, false);
/* bytes copied */ /* bytes copied */
return local_sg_elem.size; return local_sg_elem.size;
} }

View File

@ -100,6 +100,8 @@ static enum task_state trace_work(void *data)
if (buffer->r_ptr >= buffer->end_addr) if (buffer->r_ptr >= buffer->end_addr)
buffer->r_ptr = (char *)buffer->r_ptr - DMA_TRACE_LOCAL_SIZE; buffer->r_ptr = (char *)buffer->r_ptr - DMA_TRACE_LOCAL_SIZE;
ipc_msg_send(d->msg, &d->posn, false);
out: out:
spin_lock_irq(&d->lock, flags); spin_lock_irq(&d->lock, flags);