[Sound-open-firmware] [PATCH] Increase timeout of DMA trace work re-scheduling if local buffer is half full.

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Dec 12 15:21:12 CET 2017


On Tue, 2017-12-12 at 14:28 +0800, yan.wang at linux.intel.com wrote:
> From: Yan Wang <yan.wang at linux.intel.com>
> 
> The timeout of work_reschedule_default() cannot be too short to finish
> work queue rescheduling. Otherwise, the work will be rescheduled wrong
> into the next timer loop.
> 
> Signed-off-by: Yan Wang <yan.wang at linux.intel.com>
> ---
>  src/lib/dma-trace.c                               | 2 +-
>  src/platform/baytrail/include/platform/platform.h | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lib/dma-trace.c b/src/lib/dma-trace.c
> index 2a5b1a6..e61ac30 100644
> --- a/src/lib/dma-trace.c
> +++ b/src/lib/dma-trace.c
> @@ -247,7 +247,7 @@ void dtrace_event(const char *e, uint32_t length)
>  
>  	/* schedule copy now if buffer > 50% full */
>  	if (trace_data->enabled && buffer->avail >= (DMA_TRACE_LOCAL_SIZE / 2))
> -		work_reschedule_default(&trace_data->dmat_work, 100);
> +		work_reschedule_default(&trace_data->dmat_work, DMA_TRACE_NOW_US);
>  }
>  
>  void dtrace_event_atomic(const char *e, uint32_t length)
> diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h
> index 4d63f7b..4559288 100644
> --- a/src/platform/baytrail/include/platform/platform.h
> +++ b/src/platform/baytrail/include/platform/platform.h
> @@ -82,6 +82,12 @@ struct reef;
>  /* the interval of DMA trace copying */
>  #define DMA_TRACE_US		500000

Since we now have two DMA trace macros, best to rename them both

This one should be (specify timescale us in the comment)

DMA_TRACE_PERIOD

>  
> +/*
> + * the interval of start DMA trace copying in special case like half fullness
> + * of local DMA trace buffer
> + */
> +#define DMA_TRACE_NOW_US	5000
> +


DMA_TRACE_RESCHEDULE_TIME

>  /* DMAC used for trace DMA */
>  #define PLATFORM_TRACE_DMAC	DMA_ID_DMAC0
>  


More information about the Sound-open-firmware mailing list