Skip to contentSkip to conversation

hw/block/nvme: fix bug with PCI IRQ pins on teardown

PATCH Applied Logan Gunthorpe 2 participants 2 messages Nov 21, 2018 – Nov 22, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/block/nvme: fix bug with PCI IRQ pins on teardown

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.

---
 hw/block/nvme.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/nvme.c +1 -0
index fc7dacb816c8..7cbed75ce5fd 100644
@@ -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;
Signature · 1 line
2.19.0
Applied
#1 lore raw

Am 21.11.2018 um 19:10 hat Logan Gunthorpe geschrieben:

Quoted 6 lines

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.

Quoted 7 lines

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.

Thanks, applied to the block branch.

Kevin