scsi: ufs: add ufs a command complete time stamp
PATCH 1/1 scsi: ufs: add ufs a command complete time stamp
Signed-off-by Zang Leigang <[email protected]>
drivers/scsi/ufs/ufshcd.c +5 -0
@@ -385,6 +385,8 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt)dev_err (hba->dev,"UPIU[%d] - issue time %lld us\n" , tag,ktime_to_us (lrbp->issue_time_stamp)); +dev_err (hba->dev,"UPIU[%d] - complete time %lld us\n" , + tag,ktime_to_us (lrbp->compl_time_stamp));dev_err (hba->dev,"UPIU[%d] - Transfer Request Descriptor phys@0x%llx\n" , tag, (u64 )lrbp->utrd_dma_addr);
@@ -1746,6 +1748,7 @@ static inlinevoid ufshcd_send_command (struct ufs_hba *hba,unsigned int task_tag) { hba->lrb[task_tag].issue_time_stamp =ktime_get (); + hba->lrb[task_tag].compl_time_stamp =ktime_set (0 ,0 );ufshcd_clk_scaling_start_busy (hba);__set_bit (task_tag, &hba->outstanding_reqs);ufshcd_writel (hba,1 << task_tag,REG_UTP_TRANSFER_REQ_DOOR_BELL );
@@ -4627,6 +4630,8 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, }if (ufshcd_is_clkscaling_supported (hba)) hba->clk_scaling.active_reqs--; + + lrbp->compl_time_stamp =ktime_get (); }/* clear corresponding bits of completed commands */
drivers/scsi/ufs/ufshcd.h +2 -0
@@ -166,6 +166,7 @@ struct ufs_pm_lvl_states {* @lun: LUN of the command * @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation) * @issue_time_stamp: time stamp for debug purposes +* @compl_time_stamp: time stamp for statistics * @req_abort_skip: skip request abort task flag */ struct ufshcd_lrb {
@@ -189,6 +190,7 @@ struct ufshcd_lrb {u8 lun;/* UPIU LUN id field is only 8-bit wide */ bool intr_cmd;ktime_t issue_time_stamp; +ktime_t compl_time_stamp;bool req_abort_skip; };
Signature · 1 line
2.7.4
Quoted 48 lines · Zang Leigang
Signed-off-by Zang Leigang <[email protected]>drivers/scsi/ufs/ufshcd.c +2
-0@@ -385,6 +385,8 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt) dev_err(hba->dev, "UPIU[%d] - issue time %lld us\n", tag, ktime_to_us(lrbp->issue_time_stamp)); +dev_err (hba->dev,"UPIU[%d] - complete time %lld us\n" , + tag,ktime_to_us (lrbp->compl_time_stamp)); dev_err(hba->dev, "UPIU[%d] - Transfer Request Descriptor phys@0x%llx\n",drivers/scsi/ufs/ufshcd.c +3
-0tag, (u64)lrbp->utrd_dma_addr);@@ -1746,6 +1748,7 @@ static inlinevoid ufshcd_send_command (struct ufs_hba *hba,unsigned int task_tag) { hba->lrb[task_tag].issue_time_stamp =ktime_get (); + hba->lrb[task_tag].compl_time_stamp =ktime_set (0 ,0 );ufshcd_clk_scaling_start_busy (hba);__set_bit (task_tag, &hba->outstanding_reqs);ufshcd_writel (hba,1 << task_tag,REG_UTP_TRANSFER_REQ_DOOR_BELL );@@ -4627,6 +4630,8 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, }if (ufshcd_is_clkscaling_supported (hba)) hba->clk_scaling.active_reqs--; + + lrbp->compl_time_stamp =ktime_get (); }drivers/scsi/ufs/ufshcd.c +0
-0/* clear corresponding bits of completed commands */ drivers/scsi/ufs/ufshcd.h +1
-0@@ -166,6 +166,7 @@ struct ufs_pm_lvl_states {* @lun: LUN of the command * @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation) * @issue_time_stamp: time stamp for debug purposes +* @compl_time_stamp: time stamp for statistics * @req_abort_skip: skip request abort task flag */ struct
ufshcd_lrb{
drivers/scsi/ufs/ufshcd.h struct ufshcd_lrb { · line 196
Quoted 7 lines
drivers/scsi/ufs/ufshcd.h +1
-0@@ -189,6 +190,7 @@ struct ufshcd_lrb {u8 lun;/* UPIU LUN id field is only 8-bit wide */ bool intr_cmd;ktime_t issue_time_stamp; +ktime_t compl_time_stamp;bool req_abort_skip; };
Looks good to me.
Reviewed-by Subhash Jadavani <[email protected]>
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Martin K. Petersen
AppliedZang,
Applied to 4.15/scsi-queue. Thank you!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering