work: enable/disable workq timer following each timer_set/clear()

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>
This commit is contained in:
Keyon Jie 2017-03-09 21:44:37 +08:00 committed by Liam Girdwood
parent 29973dfa78
commit 2e7a2af3b9
1 changed files with 2 additions and 2 deletions

View File

@ -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);