Skip to content

Commit 2f9423b

Browse files
nvme-pci: acquire cq_poll_lock in nvme_poll_irqdisable
JIRA: https://issues.redhat.com/browse/RHEL-95382 We need to lock this queue for that condition because the timeout work executes per-namespace and can poll the poll CQ. Reported-by: Hannes Reinecke <hare@kernel.org> Closes: https://lore.kernel.org/all/20240902130728.1999-1-hare@kernel.org/ Fixes: a0fa964 ("NVMe: add blk polling support") Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Daniel Wagner <wagi@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de> (cherry picked from commit 3d89321) Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
1 parent 84219f3 commit 2f9423b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,9 @@ static void nvme_poll_irqdisable(struct nvme_queue *nvmeq)
12021202
WARN_ON_ONCE(test_bit(NVMEQ_POLLED, &nvmeq->flags));
12031203

12041204
disable_irq(pci_irq_vector(pdev, nvmeq->cq_vector));
1205+
spin_lock(&nvmeq->cq_poll_lock);
12051206
nvme_poll_cq(nvmeq, NULL);
1207+
spin_unlock(&nvmeq->cq_poll_lock);
12061208
enable_irq(pci_irq_vector(pdev, nvmeq->cq_vector));
12071209
}
12081210

0 commit comments

Comments
 (0)