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

yan.wang at linux.intel.com yan.wang at linux.intel.com
Tue Dec 12 07:28:09 CET 2017


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
 
+/*
+ * the interval of start DMA trace copying in special case like half fullness
+ * of local DMA trace buffer
+ */
+#define DMA_TRACE_NOW_US	5000
+
 /* DMAC used for trace DMA */
 #define PLATFORM_TRACE_DMAC	DMA_ID_DMAC0
 
-- 
2.7.4



More information about the Sound-open-firmware mailing list