We need enable/disable workq timer also after each calling to set/clear timer, but not only CPU frequency change, so merge them into work_set/clear_timer().
Signed-off-by: Keyon Jie yang.jie@linux.intel.com --- src/lib/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/work.c b/src/lib/work.c index 55a6f90..7da6f68 100644 --- a/src/lib/work.c +++ b/src/lib/work.c @@ -75,11 +75,13 @@ static struct work_queue *queue_; static inline void work_set_timer(struct work_queue *queue, uint32_t ticks) { queue->ts->timer_set(&queue->ts->timer, ticks); + timer_enable(&queue->ts->timer); }
static inline void work_clear_timer(struct work_queue *queue) { queue->ts->timer_clear(&queue->ts->timer); + timer_disable(&queue->ts->timer); }
static inline uint32_t work_get_timer(struct work_queue *queue) @@ -308,10 +310,8 @@ static void work_notify(int message, void *data, void *event_data) queue->ticks_per_usec * PLATFORM_WORKQ_WINDOW; queue_recalc_timers(queue, clk_data); queue_reschedule(queue); - timer_enable(&queue->ts->timer); } else if (message == CLOCK_NOTIFY_PRE) { /* CPU frequency update pending */ - timer_disable(&queue->ts->timer); }
spin_unlock_irq(&queue->lock, flags);