]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-pci: Hold cq_poll_lock while completing CQEs
authorBijan Mottahedeh <bijan.mottahedeh@oracle.com>
Thu, 27 Feb 2020 02:53:43 +0000 (18:53 -0800)
committerKeith Busch <kbusch@kernel.org>
Thu, 27 Feb 2020 16:32:14 +0000 (01:32 +0900)
commit2f3d95d3da8a8fccfc88b478e8ea4f095c62212e
treeabe811e8684f25b41397639a2c41b54466bbc8a1
parentc76bacce6f5d0cf11713c2c0a041adbef718f802
nvme-pci: Hold cq_poll_lock while completing CQEs

Completions need to consumed in the same order the controller submitted
them, otherwise future completion entries may overwrite ones we haven't
handled yet. Hold the nvme queue's poll lock while completing new CQEs to
prevent another thread from freeing command tags for reuse out-of-order.

Fixes: 8e39241bb670 ("nvme: provide optimized poll function for separate poll queues")
Signed-off-by: Bijan Mottahedeh <bijan.mottahedeh@oracle.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c