From patchwork Sat May 8 07:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhu, Lingshan" X-Patchwork-Id: 12245901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92E84C433B4 for ; Sat, 8 May 2021 07:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A7D76147D for ; Sat, 8 May 2021 07:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbhEHHSw (ORCPT ); Sat, 8 May 2021 03:18:52 -0400 Received: from mga07.intel.com ([134.134.136.100]:47276 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbhEHHSv (ORCPT ); Sat, 8 May 2021 03:18:51 -0400 IronPort-SDR: yBdZ75bIQn1Hl26P6QEmxPRyaOpaNBUAURl3mCe3XKGVYegBtTeaphoSZt9mwfNRqkxWn29/AP BIPgzQcMuoFg== X-IronPort-AV: E=McAfee;i="6200,9189,9977"; a="262816443" X-IronPort-AV: E=Sophos;i="5.82,283,1613462400"; d="scan'208";a="262816443" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2021 00:17:48 -0700 IronPort-SDR: tsgzUZs8tvIizuU72JMmEcN+UYuWGP/CHbcmGM8z+23NbbZK5biOyHJbY9Jc5+K3XprAjh2AvC lg6GkNlVctWg== X-IronPort-AV: E=Sophos;i="5.82,283,1613462400"; d="scan'208";a="435267317" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.193.73]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2021 00:17:45 -0700 From: Zhu Lingshan To: jasowang@redhat.com, mst@redhat.com, maz@kernel.org, alex.williamson@redhat.com Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, cohuck@redhat.com, stable@vger.kernel.org, Zhu Lingshan Subject: [PATCH] Revert "irqbypass: do not start cons/prod when failed connect" Date: Sat, 8 May 2021 15:11:52 +0800 Message-Id: <20210508071152.722425-1-lingshan.zhu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 Reported-by: Shaokun Zhang Acked-by: Marc Zyngier Reviewed-by: Eric Auger Tested-by: Shaokun Zhang Acked-by: Jason Wang Acked-by: Michael S. Tsirkin --- 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; }