summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorOhad Sharabi <ohad.sharabi@wdc.com>2018-08-05 16:26:23 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-08-08 21:55:48 -0400
commite7c3b37983c4ed038a3b982aa3dafc76dfa86249 (patch)
treeb6374d341230045d0281ccdb8afab4a78e67554a /drivers/scsi
parente9f7be0c4316a0ea1c47b1e800baa58fb937096c (diff)
scsi: ufs: remove unnecessary query(DM) UPIU trace
This patch removes redundant trace that occurs when sending Device Management(DM) request (fix behavior in commit 6667e6d91c88 ("scsi: ufs: add trace event for ufs upiu"). Since the function send_command is called also for DM request, UPIU trace for DM request is called twice- one identified as query_* the other as send/complete. Signed-off-by: Ohad Sharabi <ohad.sharabi@wdc.com> Fixes: 6667e6d91c88 ("scsi: ufs: add trace event for ufs upiu") Reviewed-by: Stanislav Nijnikov <stanislav.nijnikov@wdc.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ufs/ufshcd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 3560185002da..9d5d2ca7fc4f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -342,18 +342,19 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba,
sector_t lba = -1;
u8 opcode = 0;
u32 intr, doorbell;
- struct ufshcd_lrb *lrbp;
+ struct ufshcd_lrb *lrbp = &hba->lrb[tag];
int transfer_len = -1;
- /* trace UPIU also */
- ufshcd_add_cmd_upiu_trace(hba, tag, str);
-
- if (!trace_ufshcd_command_enabled())
+ if (!trace_ufshcd_command_enabled()) {
+ /* trace UPIU W/O tracing command */
+ if (lrbp->cmd)
+ ufshcd_add_cmd_upiu_trace(hba, tag, str);
return;
-
- lrbp = &hba->lrb[tag];
+ }
if (lrbp->cmd) { /* data phase exists */
+ /* trace UPIU also */
+ ufshcd_add_cmd_upiu_trace(hba, tag, str);
opcode = (u8)(*lrbp->cmd->cmnd);
if ((opcode == READ_10) || (opcode == WRITE_10)) {
/*