Commit 3d893213 authored by Keith Busch's avatar Keith Busch Committed by Christoph Hellwig
Browse files

nvme-pci: acquire cq_poll_lock in nvme_poll_irqdisable



We need to lock this queue for that condition because the timeout work
executes per-namespace and can poll the poll CQ.

Reported-by: default avatarHannes Reinecke <hare@kernel.org>
Closes: https://lore.kernel.org/all/20240902130728.1999-1-hare@kernel.org/


Fixes: a0fa9647 ("NVMe: add blk polling support")
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarDaniel Wagner <wagi@kernel.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 40696426
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1202,7 +1202,9 @@ static void nvme_poll_irqdisable(struct nvme_queue *nvmeq)
	WARN_ON_ONCE(test_bit(NVMEQ_POLLED, &nvmeq->flags));

	disable_irq(pci_irq_vector(pdev, nvmeq->cq_vector));
	spin_lock(&nvmeq->cq_poll_lock);
	nvme_poll_cq(nvmeq, NULL);
	spin_unlock(&nvmeq->cq_poll_lock);
	enable_irq(pci_irq_vector(pdev, nvmeq->cq_vector));
}