Skip to contentSkip to conversation

nvme-apple: use nvme core helper to cancel requests in tagset

PATCH Applied Guixin Liu 5 participants 5 messages Jul 8, 2022 – Jul 12, 2022

Subsystems (2)
lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvme-apple: use nvme core helper to cancel requests in tagset

Use nvme core helper nvme_cancel_tagset and nvme_cancel_admin_tagset instead of same logic code.

---
 drivers/nvme/host/apple.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/nvme/host/apple.c +2 -5
index d702d7d..7816b5a 100644
@@ -845,11 +845,8 @@ static void apple_nvme_disable(struct apple_nvme *anv, bool shutdown)
 	apple_nvme_handle_cq(&anv->adminq, true);
 	spin_unlock_irqrestore(&anv->lock, flags);
 
-	blk_mq_tagset_busy_iter(&anv->tagset, nvme_cancel_request, &anv->ctrl);
-	blk_mq_tagset_busy_iter(&anv->admin_tagset, nvme_cancel_request,
-				&anv->ctrl);
-	blk_mq_tagset_wait_completed_request(&anv->tagset);
-	blk_mq_tagset_wait_completed_request(&anv->admin_tagset);
+	nvme_cancel_tagset(&anv->ctrl);
+	nvme_cancel_admin_tagset(&anv->ctrl);
 
 	/*
 	 * The driver will not be starting up queues again if shutting down so
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Guixin Liu

Use nvme core helper nvme_cancel_tagset and nvme_cancel_admin_tagset instead of same logic code.

---
  drivers/nvme/host/apple.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/nvme/host/apple.c +0 -0
index d702d7d..7816b5a 100644
@@ -845,11 +845,8 @@ static void apple_nvme_disable(struct apple_nvme *anv, bool shutdown)
  	apple_nvme_handle_cq(&anv->adminq, true);
  	spin_unlock_irqrestore(&anv->lock, flags);
 

drivers/nvme/host/apple.c static void apple_nvme_disable(struct apple_nvme *anv, bool shutdown) · line 852

Quoted 10 lines
drivers/nvme/host/apple.c +2 -5
-	blk_mq_tagset_busy_iter(&anv->tagset, nvme_cancel_request, &anv->ctrl);
-	blk_mq_tagset_busy_iter(&anv->admin_tagset, nvme_cancel_request,
-				&anv->ctrl);
-	blk_mq_tagset_wait_completed_request(&anv->tagset);
-	blk_mq_tagset_wait_completed_request(&anv->admin_tagset);
+	nvme_cancel_tagset(&anv->ctrl);
+	nvme_cancel_admin_tagset(&anv->ctrl);
 
  	/*
  	 * The driver will not be starting up queues again if shutting down so

Looks good to me,