haven: irq_lend: handle irq accept failure case

When PVM lend an IRQ, a notification is given to SVM. Later SVM can
accept the IRQ that is lend by PVM. If the SVM do not accept an IRQ,
PVM can reclaim it back and lend again to SVM. This scenario is not
handled correctly and notification for lend from PVM to SVM is not
happening. Do an extra check in the callback handler whether previous
lend succeeded or not.

Change-Id: I9a6d335b6c11c8aea956fa1535b093c385e4cde1
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
This commit is contained in:
Murali Nalajala 2020-10-26 14:01:05 -07:00
commit eb84f8329c

View file

@ -116,7 +116,8 @@ static int hh_irq_lent_nb_handler(struct notifier_block *this,
spin_lock_irqsave(&hh_irq_lend_lock, flags);
for (label = 0; label < HH_IRQ_LABEL_MAX; label++) {
entry = &hh_irq_entries[label];
if (entry->state != HH_IRQ_STATE_WAIT_LEND)
if (entry->state != HH_IRQ_STATE_WAIT_LEND &&
entry->state != HH_IRQ_STATE_LENT)
continue;
if (label == lent->virq_label &&