mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
HV: check to avoid interrupt delay timer add twice
to edge interrupt, like eth device, it can triger the interrupt again when its IRQ in softirq entry queue or in timer list. in current design, for sofrirq entry, it calls "list_del" before "list_add_tail", to avoid the entry added twice. so for interrupt delay timer, add to check if it is started then just drop the next one; to avoid it enqueue twice. Tracked-On: #2365 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -86,6 +86,18 @@ static inline bool timer_expired(const struct hv_timer *timer)
|
||||
return ((timer->fire_tsc == 0UL) || (rdtsc() >= timer->fire_tsc));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check a timer whether in timer list.
|
||||
*
|
||||
* @param[in] timer Pointer to timer.
|
||||
*
|
||||
* @retval true if the timer is in timer list, false otherwise.
|
||||
*/
|
||||
static inline bool timer_is_started(const struct hv_timer *timer)
|
||||
{
|
||||
return (!list_empty(&timer->node));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add a timer.
|
||||
*
|
||||
|
Reference in New Issue
Block a user