]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvme-pci: skip nvme_write_sq_db on empty rqlist
authorMaurizio Lombardi <mlombard@redhat.com>
Mon, 31 Mar 2025 16:28:59 +0000 (18:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:42 +0000 (16:35 +0200)
[ Upstream commit 288ff0d10beb069355036355d5f7612579dc869c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c

index 2bddc9f60fecc9cac08299c5270ebccf47df9953..fdc9f1df0578b78c154f6233ee1b9363dd326d33 100644 (file)
@@ -989,6 +989,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);