Hi,
This small series fixes and simplifies setup_xfer_req vop and request's completion timestamp.
Stanley Chu (2):
scsi: ufs: Simplify completion timestamp for SCSI and query commands
scsi: ufs: Fix and simplify setup_xfer_req variant operation
drivers/scsi/ufs/ufshcd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--
2.18.0
Simplify recording command completion time in
__ufshcd_transfer_req_compl() by assigning lrbp->compl_time_stamp
in an unified location.
Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 18da2d64f9fa..71e8d7c782bd 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4881,6 +4881,7 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
for_each_set_bit(index, &completed_reqs, hba->nutrs) {
lrbp = &hba->lrb[index];
+ lrbp->compl_time_stamp = ktime_get();
cmd = lrbp->cmd;
if (cmd) {
ufshcd_add_command_trace(hba, index, "complete");
@@ -4889,13 +4890,11 @@ 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");
--
2.18.0
Looks good to me.
Thanks,
Avri
>
> Hi,
> This small series fixes and simplifies setup_xfer_req vop and request's
> completion timestamp.
>
> Stanley Chu (2):
> scsi: ufs: Simplify completion timestamp for SCSI and query commands
> scsi: ufs: Fix and simplify setup_xfer_req variant operation
>
> drivers/scsi/ufs/ufshcd.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> --
> 2.18.0
On Mon, 6 Jul 2020 14:07:05 +0800, Stanley Chu wrote:
> This small series fixes and simplifies setup_xfer_req vop and request's completion timestamp.
>
> Stanley Chu (2):
> scsi: ufs: Simplify completion timestamp for SCSI and query commands
> scsi: ufs: Fix and simplify setup_xfer_req variant operation
>
> drivers/scsi/ufs/ufshcd.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Applied to 5.9/scsi-queue, thanks!
[1/2] scsi: ufs: Simplify completion timestamp for SCSI and query commands
https://git.kernel.org/mkp/scsi/c/a3170376f7db
[2/2] scsi: ufs: Fix and simplify setup_xfer_req variant operation
https://git.kernel.org/mkp/scsi/c/6edfdcfe285e
--
Martin K. Petersen Oracle Linux Engineering
On 2020-07-06 14:07, Stanley Chu wrote:
> Simplify recording command completion time in
> __ufshcd_transfer_req_compl() by assigning lrbp->compl_time_stamp
> in an unified location.
>
> Signed-off-by: Stanley Chu <[email protected]>
Reviewed-by: Can Guo <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 18da2d64f9fa..71e8d7c782bd 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -4881,6 +4881,7 @@ static void __ufshcd_transfer_req_compl(struct
> ufs_hba *hba,
>
> for_each_set_bit(index, &completed_reqs, hba->nutrs) {
> lrbp = &hba->lrb[index];
> + lrbp->compl_time_stamp = ktime_get();
> cmd = lrbp->cmd;
> if (cmd) {
> ufshcd_add_command_trace(hba, index, "complete");
> @@ -4889,13 +4890,11 @@ 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");