diff options
author | Bean Huo <beanhuo@micron.com> | 2021-01-05 12:34:46 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-01-07 22:29:10 -0500 |
commit | 867fdc2d6e34635b2708cfa5d7e1100b3f298337 (patch) | |
tree | c043bd0662f9af848d1f30d820080b6625c315ae /drivers/scsi/ufs | |
parent | 0ed083e916620a1ea95f7e0722ce8bcc001f9caf (diff) | |
download | linux-867fdc2d6e34635b2708cfa5d7e1100b3f298337.tar.gz linux-867fdc2d6e34635b2708cfa5d7e1100b3f298337.tar.bz2 linux-867fdc2d6e34635b2708cfa5d7e1100b3f298337.zip |
scsi: ufs: Make UPIU trace easier differentiate among CDB, OSF, and TM
Transaction Specific Fields (TSF) in the UPIU package could be CDB
(SCSI/UFS Command Descriptor Block), OSF (Opcode Specific Field), and TM
I/O parameter (Task Management Input/Output Parameter). But, currently, we
take all of these as CDB in the UPIU trace. Thus makes user confuse among
CDB, OSF, and TM message. So fix it with this patch.
Link: https://lore.kernel.org/r/20210105113446.16027-7-huobean@gmail.com
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufs.h | 7 | ||||
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index ba24b504f85a..50f46f3bc8a2 100644 --- a/drivers/scsi/ufs/ufs.h +++ b/drivers/scsi/ufs/ufs.h @@ -554,6 +554,13 @@ enum ufs_trace_str_t { UFS_TM_SEND, UFS_TM_COMP, UFS_TM_ERR }; +/* + * Transaction Specific Fields (TSF) type in the UPIU package, this enum is + * used in include/trace/events/ufs.h for UFS command trace. + */ +enum ufs_trace_tsf_t { + UFS_TSF_CDB, UFS_TSF_OSF, UFS_TSF_TM_INPUT, UFS_TSF_TM_OUTPUT +}; /** * ufs_is_valid_unit_desc_lun - checks if the given LUN has a unit descriptor diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9879b79e62f0..53fd59ce50b2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -312,7 +312,8 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag, if (!trace_ufshcd_upiu_enabled()) return; - trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb); + trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb, + UFS_TSF_CDB); } static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag, @@ -329,7 +330,7 @@ static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag, rq_rsp = (struct utp_upiu_req *)hba->lrb[tag].ucd_rsp_ptr; trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq_rsp->header, - &rq_rsp->qr); + &rq_rsp->qr, UFS_TSF_OSF); } static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag, @@ -343,10 +344,10 @@ static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag, if (str_t == UFS_TM_SEND) trace_ufshcd_upiu(dev_name(hba->dev), str_t, &descp->req_header, - &descp->input_param1); + &descp->input_param1, UFS_TSF_TM_INPUT); else trace_ufshcd_upiu(dev_name(hba->dev), str_t, &descp->rsp_header, - &descp->output_param1); + &descp->output_param1, UFS_TSF_TM_OUTPUT); } static void ufshcd_add_uic_command_trace(struct ufs_hba *hba, |