mirror of https://github.com/thesofproject/sof.git
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:
parent
9fadef789e
commit
ed5d2feaf6
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue