Skip to content

Commit 85adf20

Browse files
damien-lemoalChristoph Hellwig
authored andcommitted
nvmet: pci-epf: clear completion queue IRQ flag on delete
The function nvmet_pci_epf_delete_cq() unconditionally calls nvmet_pci_epf_remove_irq_vector() even for completion queues that do not have interrupts enabled. Furthermore, for completion queues that do have IRQ enabled, deleting and re-creating the completion queue leaves the flag NVMET_PCI_EPF_Q_IRQ_ENABLED set, even if the completion queue is being re-created with IRQ disabled. Fix these issues by calling nvmet_pci_epf_remove_irq_vector() only if NVMET_PCI_EPF_Q_IRQ_ENABLED is set and make sure to always clear that flag. Fixes: 0faa0fe ("nvmet: New NVMe PCI endpoint function target driver") Cc: [email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 3d89321 commit 85adf20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/target/pci-epf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,8 @@ static u16 nvmet_pci_epf_delete_cq(struct nvmet_ctrl *tctrl, u16 cqid)
13441344

13451345
cancel_delayed_work_sync(&cq->work);
13461346
nvmet_pci_epf_drain_queue(cq);
1347-
nvmet_pci_epf_remove_irq_vector(ctrl, cq->vector);
1347+
if (test_and_clear_bit(NVMET_PCI_EPF_Q_IRQ_ENABLED, &cq->flags))
1348+
nvmet_pci_epf_remove_irq_vector(ctrl, cq->vector);
13481349
nvmet_pci_epf_mem_unmap(ctrl->nvme_epf, &cq->pci_map);
13491350

13501351
return NVME_SC_SUCCESS;

0 commit comments

Comments
 (0)