From eb84f8329c70f8c46e50c977f26afd1aadb95405 Mon Sep 17 00:00:00 2001 From: Murali Nalajala Date: Mon, 26 Oct 2020 14:01:05 -0700 Subject: [PATCH] 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 --- drivers/virt/haven/hh_irq_lend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/virt/haven/hh_irq_lend.c b/drivers/virt/haven/hh_irq_lend.c index 9e4a7fb4d354..c132b26b6cf2 100644 --- a/drivers/virt/haven/hh_irq_lend.c +++ b/drivers/virt/haven/hh_irq_lend.c @@ -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 &&