* [PATCH v2] scsi: ufs: remove unnecessary query(DM) UPIU trace
@ 2018-08-05 13:26 Ohad Sharabi
2018-08-09 1:57 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Ohad Sharabi @ 2018-08-05 13:26 UTC (permalink / raw)
To: stanislav.nijnikov, avri.altman, alex.lemberg, jejb,
martin.petersen, gregkh
Cc: linux-scsi, linux-kernel, Ohad Sharabi
This patch removes redundant trace that occurs when sending Device
Management(DM) request (fix behavior in patch
https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git/commit/?id=6667e6d91c88a788d5ab1b1e999d245473e84a9)
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>
reviewed-by: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
reviewed-by: Avri Altman <avri.altman@wdc.com>
---
v1->v2:
- modify sender's domain (sandisk->wdc)
- add reviewers
drivers/scsi/ufs/ufshcd.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 397081d..33e6dd0 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -321,18 +321,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)) {
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] scsi: ufs: remove unnecessary query(DM) UPIU trace
2018-08-05 13:26 [PATCH v2] scsi: ufs: remove unnecessary query(DM) UPIU trace Ohad Sharabi
@ 2018-08-09 1:57 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2018-08-09 1:57 UTC (permalink / raw)
To: Ohad Sharabi
Cc: stanislav.nijnikov, avri.altman, alex.lemberg, jejb,
martin.petersen, gregkh, linux-scsi, linux-kernel
Ohad,
> This patch removes redundant trace that occurs when sending Device
> Management(DM) request (fix behavior in patch
> https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git/commit/?id=6667e6d91c88a788d5ab1b1e999d245473e84a9)
> 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.
Applied to 4.19/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-09 1:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-05 13:26 [PATCH v2] scsi: ufs: remove unnecessary query(DM) UPIU trace Ohad Sharabi
2018-08-09 1:57 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).