diff mbox series

[v2] scsi:ufs:core: update compl_time_stamp_local_clock after complete a cqe

Message ID 1733470182-220841-1-git-send-email-liuderong@oppo.com (mailing list archive)
State Accepted
Headers show
Series [v2] scsi:ufs:core: update compl_time_stamp_local_clock after complete a cqe | expand

Commit Message

liuderong Dec. 6, 2024, 7:29 a.m. UTC
From: liuderong <liuderong@oppo.com>

For now, lrbp->compl_time_stamp_local_clock is set to zero
after send a sqe, but it is not updated after complete a cqe,
the printed information in ufshcd_print_tr will always be zero.
So update lrbp->cmpl_time_stamp_local_clock after complete a cqe.

Log sample:
ufshcd-qcom 1d84000.ufshc: UPIU[8] - issue time 8750227249 us
ufshcd-qcom 1d84000.ufshc: UPIU[8] - complete time 0 us

Fixes: c30d8d010b5e ("scsi: ufs: core: Prepare for completion in MCQ")
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: liuderong <liuderong@oppo.com>
---
v1 -> v2: add fixes tag 
 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Avri Altman Dec. 7, 2024, 4:30 a.m. UTC | #1
> From: liuderong <liuderong@oppo.com>
> 
> For now, lrbp->compl_time_stamp_local_clock is set to zero
> after send a sqe, but it is not updated after complete a cqe,
> the printed information in ufshcd_print_tr will always be zero.
> So update lrbp->cmpl_time_stamp_local_clock after complete a cqe.
> 
> Log sample:
> ufshcd-qcom 1d84000.ufshc: UPIU[8] - issue time 8750227249 us
> ufshcd-qcom 1d84000.ufshc: UPIU[8] - complete time 0 us
> 
> Fixes: c30d8d010b5e ("scsi: ufs: core: Prepare for completion in MCQ")
> Reviewed-by: Bean Huo <beanhuo@micron.com>
> Reviewed-by: Peter Wang <peter.wang@mediatek.com>
> Signed-off-by: liuderong <liuderong@oppo.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Bart Van Assche Dec. 9, 2024, 9:54 p.m. UTC | #2
On 12/5/24 11:29 PM, liuderong@oppo.com wrote:
> From: liuderong <liuderong@oppo.com>
> 
> For now, lrbp->compl_time_stamp_local_clock is set to zero
> after send a sqe, but it is not updated after complete a cqe,
> the printed information in ufshcd_print_tr will always be zero.
> So update lrbp->cmpl_time_stamp_local_clock after complete a cqe.
> 
> Log sample:
> ufshcd-qcom 1d84000.ufshc: UPIU[8] - issue time 8750227249 us
> ufshcd-qcom 1d84000.ufshc: UPIU[8] - complete time 0 us
> 
> Fixes: c30d8d010b5e ("scsi: ufs: core: Prepare for completion in MCQ")
> Reviewed-by: Bean Huo <beanhuo@micron.com>
> Reviewed-by: Peter Wang <peter.wang@mediatek.com>
> Signed-off-by: liuderong <liuderong@oppo.com>
> ---
> v1 -> v2: add fixes tag
>   drivers/ufs/core/ufshcd.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 6a26853..bd70fe1 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -5519,6 +5519,7 @@ void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag,
>   
>   	lrbp = &hba->lrb[task_tag];
>   	lrbp->compl_time_stamp = ktime_get();
> +	lrbp->compl_time_stamp_local_clock = local_clock();
>   	cmd = lrbp->cmd;
>   	if (cmd) {
>   		if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))

Although this patch looks good to me: an infrastructure for gathering
I/O statistics should not occur in the UFS driver. This functionality
should be moved into the block layer core.

Thanks,

Bart.
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 6a26853..bd70fe1 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5519,6 +5519,7 @@  void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag,
 
 	lrbp = &hba->lrb[task_tag];
 	lrbp->compl_time_stamp = ktime_get();
+	lrbp->compl_time_stamp_local_clock = local_clock();
 	cmd = lrbp->cmd;
 	if (cmd) {
 		if (unlikely(ufshcd_should_inform_monitor(hba, lrbp)))