qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/block/nvme: fix bug with PCI IRQ pins on teardown
@ 2018-11-21 18:10 Logan Gunthorpe
  2018-11-22 15:24 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Logan Gunthorpe @ 2018-11-21 18:10 UTC (permalink / raw)
  To: qemu-block, Keith Busch
  Cc: qemu-devel, Kevin Wolf, Max Reitz, Stephen Bates, Logan Gunthorpe

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 <logang@deltatee.com>
---
 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;
-- 
2.19.0

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

* Re: [Qemu-devel] [PATCH] hw/block/nvme: fix bug with PCI IRQ pins on teardown
  2018-11-21 18:10 [Qemu-devel] [PATCH] hw/block/nvme: fix bug with PCI IRQ pins on teardown Logan Gunthorpe
@ 2018-11-22 15:24 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2018-11-22 15:24 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: qemu-block, Keith Busch, qemu-devel, Max Reitz, Stephen Bates

Am 21.11.2018 um 19:10 hat Logan Gunthorpe geschrieben:
> 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 <logang@deltatee.com>

Thanks, applied to the block branch.

Kevin

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

end of thread, other threads:[~2018-11-22 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-21 18:10 [Qemu-devel] [PATCH] hw/block/nvme: fix bug with PCI IRQ pins on teardown Logan Gunthorpe
2018-11-22 15:24 ` Kevin Wolf

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).