From patchwork Wed Nov 21 18:10:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10692949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68D0D1709 for ; Wed, 21 Nov 2018 18:19:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58AC02C48E for ; Wed, 21 Nov 2018 18:19:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C77F2C490; Wed, 21 Nov 2018 18:19:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D74812C48E for ; Wed, 21 Nov 2018 18:19:32 +0000 (UTC) Received: from localhost ([::1]:41066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPX63-0002cL-Nc for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Nov 2018 13:19:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPX3L-00005w-N3 for qemu-devel@nongnu.org; Wed, 21 Nov 2018 13:16:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPWxM-0002AH-I8 for qemu-devel@nongnu.org; Wed, 21 Nov 2018 13:10:33 -0500 Received: from ale.deltatee.com ([207.54.116.67]:42046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPWxG-00020z-Ig; Wed, 21 Nov 2018 13:10:27 -0500 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gPWxD-0006g8-83; Wed, 21 Nov 2018 11:10:24 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1gPWxB-0001J5-My; Wed, 21 Nov 2018 11:10:21 -0700 From: Logan Gunthorpe To: qemu-block@nongnu.org, Keith Busch Date: Wed, 21 Nov 2018 11:10:13 -0700 Message-Id: <20181121181013.4983-1-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: keith.busch@intel.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, kwolf@redhat.com, mreitz@redhat.com, stephen@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.54.116.67 Subject: [Qemu-devel] [PATCH] hw/block/nvme: fix bug with PCI IRQ pins on teardown X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Logan Gunthorpe , qemu-devel@nongnu.org, Stephen Bates , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When the submission and completion queues are being torn down the IRQ will be asserted for the completion queue when the submsission queue is deleted. Then when the completion queue is deleted it stays asserted. Thus, on systems that do not use MSI, no further interrupts can be triggered on the host. Linux sees this as a long delay when unbinding the nvme device. Eventually the interrupt timeout occurs and it continues. To fix this we ensure we deassert the IRQ for a CQ when it is deleted. Signed-off-by: Logan Gunthorpe --- hw/block/nvme.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index fc7dacb816c8..7cbed75ce5fd 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -554,6 +554,7 @@ static uint16_t nvme_del_cq(NvmeCtrl *n, NvmeCmd *cmd) trace_nvme_err_invalid_del_cq_notempty(qid); return NVME_INVALID_QUEUE_DEL; } + nvme_irq_deassert(n, cq); trace_nvme_del_cq(qid); nvme_free_cq(cq, n); return NVME_SUCCESS;