kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "irqbypass: do not start cons/prod when failed connect"
@ 2021-05-08  7:11 Zhu Lingshan
  2021-05-08  7:22 ` Greg KH
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Zhu Lingshan @ 2021-05-08  7:11 UTC (permalink / raw)
  To: jasowang, mst, maz, alex.williamson
  Cc: kvm, linux-arm-kernel, kvmarm, cohuck, stable, Zhu Lingshan

This reverts commit a979a6aa009f3c99689432e0cdb5402a4463fb88.

The reverted commit may cause VM freeze on arm64 platform.
Because on arm64 platform, stop a consumer will suspend the VM,
the VM will freeze without a start consumer

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
---
 virt/lib/irqbypass.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c
index c9bb3957f58a..28fda42e471b 100644
--- a/virt/lib/irqbypass.c
+++ b/virt/lib/irqbypass.c
@@ -40,21 +40,17 @@ static int __connect(struct irq_bypass_producer *prod,
 	if (prod->add_consumer)
 		ret = prod->add_consumer(prod, cons);
 
-	if (ret)
-		goto err_add_consumer;
-
-	ret = cons->add_producer(cons, prod);
-	if (ret)
-		goto err_add_producer;
+	if (!ret) {
+		ret = cons->add_producer(cons, prod);
+		if (ret && prod->del_consumer)
+			prod->del_consumer(prod, cons);
+	}
 
 	if (cons->start)
 		cons->start(cons);
 	if (prod->start)
 		prod->start(prod);
-err_add_producer:
-	if (prod->del_consumer)
-		prod->del_consumer(prod, cons);
-err_add_consumer:
+
 	return ret;
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-11  8:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  7:11 [PATCH] Revert "irqbypass: do not start cons/prod when failed connect" Zhu Lingshan
2021-05-08  7:22 ` Greg KH
2021-05-08  9:29 ` Marc Zyngier
2021-05-09 17:04   ` Auger Eric
2021-05-10  1:12   ` Shaokun Zhang
2021-05-10  7:39     ` Marc Zyngier
2021-05-10  2:43 ` Jason Wang
2021-05-10  3:00   ` Zhu, Lingshan
2021-05-10  4:34     ` Jason Wang
2021-05-10  7:09       ` Zhu, Lingshan
2021-05-10  8:32         ` Zhu, Lingshan
2021-05-10 10:00           ` Marc Zyngier
2021-05-10 10:37             ` Zhu, Lingshan
2021-05-10 11:01 ` Marc Zyngier
2021-05-11  8:48 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).