Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guixin Liu <kanie@linux.alibaba.com>
To: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Nilay Shroff <nilay@linux.ibm.com>,
	Daniel Wagner <dwagner@suse.de>, Hannes Reinecke <hare@suse.de>
Cc: linux-nvme@lists.infradead.org
Subject: [PATCH v2 1/9] nvme-pci: remove write-only NVMEQ_DELETE_ERROR flag
Date: Fri,  6 Nov 2026 10:27:28 +0800	[thread overview]
Message-ID: <20261106022736.3582824-2-kanie@linux.alibaba.com> (raw)
In-Reply-To: <20261106022736.3582824-1-kanie@linux.alibaba.com>

Commit fa46c6fb5d61b ("nvme/pci: move cqe check after device shutdown")
removed the only reader of the NVMEQ_DELETE_ERROR flag, but left the
flag and its two writes behind. Without a reader the flag carries no
state, and nvme_del_cq_end() degenerates to a plain wrapper around
nvme_del_queue_end(), which the SQ deletion path already uses directly.

Remove the flag, its writes, and the now redundant wrapper.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/nvme/host/pci.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 8a90639789c9..6f6bb9a2486c 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -388,7 +388,6 @@ struct nvme_queue {
 	unsigned long flags;
 #define NVMEQ_ENABLED		0
 #define NVMEQ_SQ_CMB		1
-#define NVMEQ_DELETE_ERROR	2
 #define NVMEQ_POLLED		3
 	__le32 *dbbuf_sq_db;
 	__le32 *dbbuf_cq_db;
@@ -2238,8 +2237,6 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
 	int result;
 	u16 vector = 0;
 
-	clear_bit(NVMEQ_DELETE_ERROR, &nvmeq->flags);
-
 	/*
 	 * A queue's vector matches the queue identifier unless the controller
 	 * has only one vector available.
@@ -3101,18 +3098,6 @@ static enum rq_end_io_ret nvme_del_queue_end(struct request *req,
 	return RQ_END_IO_NONE;
 }
 
-static enum rq_end_io_ret nvme_del_cq_end(struct request *req,
-					  blk_status_t error,
-					  const struct io_comp_batch *iob)
-{
-	struct nvme_queue *nvmeq = req->end_io_data;
-
-	if (error)
-		set_bit(NVMEQ_DELETE_ERROR, &nvmeq->flags);
-
-	return nvme_del_queue_end(req, error, iob);
-}
-
 static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode)
 {
 	struct request_queue *q = nvmeq->dev->ctrl.admin_q;
@@ -3127,10 +3112,7 @@ static int nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode)
 		return PTR_ERR(req);
 	nvme_init_request(req, &cmd);
 
-	if (opcode == nvme_admin_delete_cq)
-		req->end_io = nvme_del_cq_end;
-	else
-		req->end_io = nvme_del_queue_end;
+	req->end_io = nvme_del_queue_end;
 	req->end_io_data = nvmeq;
 
 	init_completion(&nvmeq->delete_done);
-- 
2.43.7



  reply	other threads:[~2026-11-06  2:27 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  2:27 [PATCH v2 0/9] nvme: dead code cleanups Guixin Liu
2026-11-06  2:27 ` Guixin Liu [this message]
2026-11-06 10:36   ` [PATCH v2 1/9] nvme-pci: remove write-only NVMEQ_DELETE_ERROR flag Christoph Hellwig
2026-11-06 13:12   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 2/9] nvme-fc: remove dead seqno field in nvme_fc_queue Guixin Liu
2026-11-06 10:36   ` Christoph Hellwig
2026-11-06 13:16   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 3/9] nvme-auth: remove dead entry field in nvme_dhchap_queue_context Guixin Liu
2026-11-06 10:36   ` Christoph Hellwig
2026-11-06 13:16   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 4/9] nvme-fabrics: remove dead hostnqn already-assigned check Guixin Liu
2026-11-06 10:36   ` Christoph Hellwig
2026-11-06 13:17   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 5/9] nvme: drop unreachable "off" case in reconnect_delay_show() Guixin Liu
2026-11-06 10:37   ` Christoph Hellwig
2026-11-06 13:17   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 6/9] nvmet-fc: remove dead fields in nvmet_fc_ls_iod and nvmet_fc_tgt_queue Guixin Liu
2026-11-06 10:37   ` Christoph Hellwig
2026-11-06 13:17   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 7/9] nvmet: remove unreachable "pcie" entry from the address family map Guixin Liu
2026-11-06 10:37   ` Christoph Hellwig
2026-11-06 13:19   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 8/9] nvmet: passthru: remove unreachable break statements Guixin Liu
2026-11-06 10:38   ` Christoph Hellwig
2026-11-06 13:20   ` Nilay Shroff
2026-11-06  2:27 ` [PATCH v2 9/9] nvmet-pci-epf: don't drain the never-populated SQ list Guixin Liu
2026-11-06 10:38   ` Christoph Hellwig
2026-11-06 13:20   ` Nilay Shroff
2026-11-06 16:13 ` [PATCH v2 0/9] nvme: dead code cleanups Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261106022736.3582824-2-kanie@linux.alibaba.com \
    --to=kanie@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=nilay@linux.ibm.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox