summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCan Guo <cang@codeaurora.org>2019-11-26 07:53:32 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-12-20 04:08:52 +0100
commit74a527a2ab1c5c09f7bf37cfb00a93b6d75fbda7 (patch)
treeba7b4589d898f178cd1953c972ae9ce841411e5d /drivers
parentscsi: ufs: Update VCCQ2 and VCCQ min/max voltage hard codes (diff)
downloadlinux-74a527a2ab1c5c09f7bf37cfb00a93b6d75fbda7.tar.xz
linux-74a527a2ab1c5c09f7bf37cfb00a93b6d75fbda7.zip
scsi: ufs: Avoid messing up the compl_time_stamp of lrbs
To be on the safe side, do not touch lrb after clearing its slot in the lrb_in_use bitmap to avoid messing up the next task which would possibly occupy this lrb. [mkp: applied by hand] Link: https://lore.kernel.org/r/1574751214-8321-4-git-send-email-cang@qti.qualcomm.com Reviewed by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r--drivers/scsi/ufs/ufshcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 839cb7badcf6..e91dc574a08a 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4793,11 +4793,13 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
cmd->result = result;
/* Mark completed command as NULL in LRB */
lrbp->cmd = NULL;
+ lrbp->compl_time_stamp = ktime_get();
/* Do not touch lrbp after scsi done */
cmd->scsi_done(cmd);
__ufshcd_release(hba);
} else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE ||
lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) {
+ lrbp->compl_time_stamp = ktime_get();
if (hba->dev_cmd.complete) {
ufshcd_add_command_trace(hba, index,
"dev_complete");
@@ -4806,8 +4808,6 @@ 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 */