* [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()
@ 2023-06-01 9:02 Stanley Chu
2023-06-01 14:38 ` Bart Van Assche
2023-06-01 18:12 ` Bao D. Nguyen
0 siblings, 2 replies; 4+ messages in thread
From: Stanley Chu @ 2023-06-01 9:02 UTC (permalink / raw)
To: linux-scsi, linux-kernel, martin.petersen, avri.altman,
alim.akhtar, jejb, bvanassche
Cc: stanley.chu
Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users,
it should be removed.
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
drivers/ufs/core/ufs-mcq.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 920eb954f594..785fc9762cad 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -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;
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()
2023-06-01 9:02 [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe() Stanley Chu
@ 2023-06-01 14:38 ` Bart Van Assche
2023-06-01 15:16 ` Stanley Chu
2023-06-01 18:12 ` Bao D. Nguyen
1 sibling, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2023-06-01 14:38 UTC (permalink / raw)
To: Stanley Chu, linux-scsi, linux-kernel, martin.petersen,
avri.altman, alim.akhtar, jejb
On 6/1/23 02:02, Stanley Chu wrote:
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()
2023-06-01 14:38 ` Bart Van Assche
@ 2023-06-01 15:16 ` Stanley Chu
0 siblings, 0 replies; 4+ messages in thread
From: Stanley Chu @ 2023-06-01 15:16 UTC (permalink / raw)
To: Bart Van Assche
Cc: Stanley Chu, linux-scsi, linux-kernel, martin.petersen,
avri.altman, alim.akhtar, jejb
On Thu, Jun 1, 2023 at 10:41 PM Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 6/1/23 02:02, Stanley Chu wrote:
> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe()
2023-06-01 9:02 [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe() Stanley Chu
2023-06-01 14:38 ` Bart Van Assche
@ 2023-06-01 18:12 ` Bao D. Nguyen
1 sibling, 0 replies; 4+ messages in thread
From: Bao D. Nguyen @ 2023-06-01 18:12 UTC (permalink / raw)
To: Stanley Chu, linux-scsi, linux-kernel, martin.petersen,
avri.altman, alim.akhtar, jejb, bvanassche
On 6/1/2023 2:02 AM, Stanley Chu wrote:
> Since ufshcd_mcq_poll_cqe_nolock() is no longer used by any users,
> it should be removed.
>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
> drivers/ufs/core/ufs-mcq.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 920eb954f594..785fc9762cad 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -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;
Hi Stanley,
Other than the commit message that Bart mentioned, this patch looks good.
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-01 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01 9:02 [PATCH v1] ufs: core: Remove the nolock version of ufshcd_mcq_poll_cqe() Stanley Chu
2023-06-01 14:38 ` Bart Van Assche
2023-06-01 15:16 ` Stanley Chu
2023-06-01 18:12 ` Bao D. Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox