2020-11-12 17:03:08

by Jaegeuk Kim

[permalink] [raw]
Subject: [PATCH] scsi: ufs: show lba and length for unmap commands

From: Leo Liou <[email protected]>

We have lba and length for unmap commands.

Signed-off-by: Leo Liou <[email protected]>
---
drivers/scsi/ufs/ufshcd.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 86c8dee01ca9..dba3ee307307 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -376,6 +376,11 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba,
lrbp->ucd_req_ptr->sc.exp_data_transfer_len);
if (opcode == WRITE_10)
group_id = lrbp->cmd->cmnd[6];
+ } else if (opcode == UNMAP) {
+ if (cmd->request) {
+ lba = scsi_get_lba(cmd);
+ transfer_len = blk_rq_bytes(cmd->request);
+ }
}
}

--
2.29.2.299.gdc1121823c-goog


2020-11-13 01:14:46

by Stanley Chu

[permalink] [raw]
Subject: Re: [PATCH] scsi: ufs: show lba and length for unmap commands

Hi,

On Thu, 2020-11-12 at 08:59 -0800, Jaegeuk Kim wrote:
> From: Leo Liou <[email protected]>
>
> We have lba and length for unmap commands.
>
> Signed-off-by: Leo Liou <[email protected]>
> ---
> drivers/scsi/ufs/ufshcd.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 86c8dee01ca9..dba3ee307307 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -376,6 +376,11 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba,
> lrbp->ucd_req_ptr->sc.exp_data_transfer_len);
> if (opcode == WRITE_10)
> group_id = lrbp->cmd->cmnd[6];
> + } else if (opcode == UNMAP) {
> + if (cmd->request) {
> + lba = scsi_get_lba(cmd);
> + transfer_len = blk_rq_bytes(cmd->request);
> + }

Nitpicking: Perhaps we could unify the method of obtaining both lba and
transfer_len for all READ/WRITE/UNMAP commands?

Reviewed-by: Stanley Chu <[email protected]>

> }
> }
>

2020-11-17 03:42:45

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: ufs: show lba and length for unmap commands


Hi Jaegeuk!

> From: Leo Liou <[email protected]>
>
> We have lba and length for unmap commands.
>
> Signed-off-by: Leo Liou <[email protected]>

Doesn't apply to 5.11/scsi-queue.

Also needs a Signed-off-by: tag from you.

Thanks!

--
Martin K. Petersen Oracle Linux Engineering

2020-11-17 17:08:59

by Jaegeuk Kim

[permalink] [raw]
Subject: Re: [PATCH] scsi: ufs: show lba and length for unmap commands

On 11/16, Martin K. Petersen wrote:
>
> Hi Jaegeuk!
>
> > From: Leo Liou <[email protected]>
> >
> > We have lba and length for unmap commands.
> >
> > Signed-off-by: Leo Liou <[email protected]>
>
> Doesn't apply to 5.11/scsi-queue.
>
> Also needs a Signed-off-by: tag from you.

Hi Martin,

Could you please consider this patch series?

https://lore.kernel.org/linux-scsi/[email protected]/

Thanks,

>
> Thanks!
>
> --
> Martin K. Petersen Oracle Linux Engineering