HV: fix bug by improving intr delay timer handling

1. it need delete intr delay timer when its ptdev entry
is deactivated to avoid the timer still active;

2. if the dequeued entry will be added by delay timer,
it need reset current variable "entry" to find next one,
or it could be returned and handled (if it is the last one)
, then the entry's IRQ can come again, and it'll cause its
timer added twice.

Tracked-On: #1476
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Minggui Cao 2018-10-18 15:15:43 +08:00 committed by wenlingz
parent 4228c81b3f
commit 241d5a684e
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,7 @@ ptdev_dequeue_softirq(struct vm *vm)
} else {
/* add it into timer list; dequeue next one */
(void)add_timer(&entry->intr_delay_timer);
entry = NULL;
}
}
@ -187,6 +188,7 @@ ptdev_deactivate_entry(struct ptdev_remapping_info *entry)
/* remove from softirq list if added */
spinlock_irqsave_obtain(&entry->vm->softirq_dev_lock, &rflags);
list_del_init(&entry->softirq_node);
del_timer(&entry->intr_delay_timer);
spinlock_irqrestore_release(&entry->vm->softirq_dev_lock, rflags);
}