Skip to contentSkip to conversation

ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()

PATCH In review Stanley Chu 4 participants 4 messages Jun 1, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()

Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users, it should be removed.

---
 drivers/ufs/core/ufs-mcq.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
drivers/ufs/core/ufs-mcq.c +4 -13
index 920eb954f594..785fc9762cad 100644
@@ -307,11 +307,13 @@ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
 	spin_unlock_irqrestore(&hwq->cq_lock, flags);
 }
 
-static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
-						struct ufs_hw_queue *hwq)
+unsigned long ufshcd_mcq_poll_cqe_lock(struct ufs_hba *hba,
+				       struct ufs_hw_queue *hwq)
 {
 	unsigned long completed_reqs = 0;
+	unsigned long flags;
 
+	spin_lock_irqsave(&hwq->cq_lock, flags);
 	ufshcd_mcq_update_cq_tail_slot(hwq);
 	while (!ufshcd_mcq_is_cq_empty(hwq)) {
 		ufshcd_mcq_process_cqe(hba, hwq);
@@ -321,17 +323,6 @@ static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
 
 	if (completed_reqs)
 		ufshcd_mcq_update_cq_head(hwq);
-
-	return completed_reqs;
-}
-
-unsigned long ufshcd_mcq_poll_cqe_lock(struct ufs_hba *hba,
-				       struct ufs_hw_queue *hwq)
-{
-	unsigned long completed_reqs, flags;
-
-	spin_lock_irqsave(&hwq->cq_lock, flags);
-	completed_reqs = ufshcd_mcq_poll_cqe_nolock(hba, hwq);
 	spin_unlock_irqrestore(&hwq->cq_lock, flags);
 
 	return completed_reqs;
Signature · 1 line
2.18.0
#1 lore raw
Quoted 2 lines · Stanley Chu

Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users, it should be removed.

This description is not correct. ufshcd_mcq_poll_cqe_nolock() is called by ufshcd_mcq_poll_cqe_lock().

Bart.

#2 lore raw
Quoted 7 lines · Bart Van Assche
Quoted 2 lines · Stanley Chu

Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users, it should be removed.

This description is not correct. ufshcd_mcq_poll_cqe_nolock() is called by ufshcd_mcq_poll_cqe_lock().

You are right. Let me fix the commit message in the next version.

Stanley

Reviewed-by on v1 1/1
#3 lore raw
In reply to Stanley Chu
Quoted 36 lines · Stanley Chu

Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users, it should be removed.

---
  drivers/ufs/core/ufs-mcq.c | 17 ++++-------------
  1 file changed, 4 insertions(+), 13 deletions(-)
drivers/ufs/core/ufs-mcq.c +4 -6
index 920eb954f594..785fc9762cad 100644
@@ -307,11 +307,13 @@ void ufshcd_mcq_compl_all_cqes_lock(struct ufs_hba *hba,
  	spin_unlock_irqrestore(&hwq->cq_lock, flags);
  }
 
-static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
-						struct ufs_hw_queue *hwq)
+unsigned long ufshcd_mcq_poll_cqe_lock(struct ufs_hba *hba,
+				       struct ufs_hw_queue *hwq)
  {
  	unsigned long completed_reqs = 0;
+	unsigned long flags;
 
+	spin_lock_irqsave(&hwq->cq_lock, flags);
  	ufshcd_mcq_update_cq_tail_slot(hwq);
  	while (!ufshcd_mcq_is_cq_empty(hwq)) {
  		ufshcd_mcq_process_cqe(hba, hwq);
@@ -321,17 +323,6 @@ static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba,
 
  	if (completed_reqs)
  		ufshcd_mcq_update_cq_head(hwq);
-
-	return completed_reqs;
-}
-

drivers/ufs/core/ufs-mcq.c static unsigned long ufshcd_mcq_poll_cqe_nolock(struct ufs_hba *hba, · line 328

Quoted 10 lines
drivers/ufs/core/ufs-mcq.c +0 -7
-unsigned long ufshcd_mcq_poll_cqe_lock(struct ufs_hba *hba,
-				       struct ufs_hw_queue *hwq)
-{
-	unsigned long completed_reqs, flags;
-
-	spin_lock_irqsave(&hwq->cq_lock, flags);
-	completed_reqs = ufshcd_mcq_poll_cqe_nolock(hba, hwq);
  	spin_unlock_irqrestore(&hwq->cq_lock, flags);
 
  	return completed_reqs;

Hi Stanley,

Other than the commit message that Bart mentioned, this patch looks good.