]> www.infradead.org Git - nvme.git/commitdiff
nvme-pci: skip nvme_write_sq_db on empty rqlist for-next
authorMaurizio Lombardi <mlombard@redhat.com>
Mon, 31 Mar 2025 16:28:59 +0000 (18:28 +0200)
committerKeith Busch <kbusch@kernel.org>
Mon, 31 Mar 2025 16:43:41 +0000 (09:43 -0700)
nvme_submit_cmds() should check the rqlist before calling
nvme_write_sq_db(); if the list is empty, it must return immediately.

Fixes: beadf0088501 ("nvme-pci: reverse request order in nvme_queue_rqs")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c

index 2883d17ee1eb0507e0c3d72716f65b642ab87ef1..b178d52eac1b7f7286e217226b9b3686d07b7b6c 100644 (file)
@@ -986,6 +986,9 @@ static void nvme_submit_cmds(struct nvme_queue *nvmeq, struct rq_list *rqlist)
 {
        struct request *req;
 
+       if (rq_list_empty(rqlist))
+               return;
+
        spin_lock(&nvmeq->sq_lock);
        while ((req = rq_list_pop(rqlist))) {
                struct nvme_iod *iod = blk_mq_rq_to_pdu(req);