* [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
@ 2017-09-06 9:58 kehuanlin
2017-09-26 21:50 ` Subhash Jadavani
2017-09-28 1:47 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: kehuanlin @ 2017-09-06 9:58 UTC (permalink / raw)
To: vinholikatti; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel, kehuanlin
Since the command type of UTRD in UFS 2.1 specification is the same with
UFS 2.0. And it assumes the future UFS specification will follow the same
definition.
Signed-off-by: kehuanlin <kehuanlin@pinecone.net>
---
drivers/scsi/ufs/ufshcd.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 5bc9dc1..c33a2f8 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2195,10 +2195,11 @@ static int ufshcd_comp_devman_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
u32 upiu_flags;
int ret = 0;
- if (hba->ufs_version == UFSHCI_VERSION_20)
- lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
- else
+ if ((hba->ufs_version == UFSHCI_VERSION_10) ||
+ (hba->ufs_version == UFSHCI_VERSION_11))
lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
+ else
+ lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
@@ -2222,10 +2223,11 @@ static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
u32 upiu_flags;
int ret = 0;
- if (hba->ufs_version == UFSHCI_VERSION_20)
- lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
- else
+ if ((hba->ufs_version == UFSHCI_VERSION_10) ||
+ (hba->ufs_version == UFSHCI_VERSION_11))
lrbp->command_type = UTP_CMD_TYPE_SCSI;
+ else
+ lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
if (likely(lrbp->cmd)) {
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
2017-09-06 9:58 [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 kehuanlin
@ 2017-09-26 21:50 ` Subhash Jadavani
2017-09-28 1:47 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Subhash Jadavani @ 2017-09-26 21:50 UTC (permalink / raw)
To: kehuanlin
Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-kernel,
kehuanlin, linux-scsi-owner
On 2017-09-06 02:58, kehuanlin wrote:
> Since the command type of UTRD in UFS 2.1 specification is the same
> with
> UFS 2.0. And it assumes the future UFS specification will follow the
> same
> definition.
>
> Signed-off-by: kehuanlin <kehuanlin@pinecone.net>
> ---
> drivers/scsi/ufs/ufshcd.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 5bc9dc1..c33a2f8 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -2195,10 +2195,11 @@ static int ufshcd_comp_devman_upiu(struct
> ufs_hba *hba, struct ufshcd_lrb *lrbp)
> u32 upiu_flags;
> int ret = 0;
>
> - if (hba->ufs_version == UFSHCI_VERSION_20)
> - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
> - else
> + if ((hba->ufs_version == UFSHCI_VERSION_10) ||
> + (hba->ufs_version == UFSHCI_VERSION_11))
> lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
> + else
> + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
>
> ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
> if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
> @@ -2222,10 +2223,11 @@ static int ufshcd_comp_scsi_upiu(struct
> ufs_hba *hba, struct ufshcd_lrb *lrbp)
> u32 upiu_flags;
> int ret = 0;
>
> - if (hba->ufs_version == UFSHCI_VERSION_20)
> - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
> - else
> + if ((hba->ufs_version == UFSHCI_VERSION_10) ||
> + (hba->ufs_version == UFSHCI_VERSION_11))
> lrbp->command_type = UTP_CMD_TYPE_SCSI;
> + else
> + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
>
> if (likely(lrbp->cmd)) {
> ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
2017-09-06 9:58 [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 kehuanlin
2017-09-26 21:50 ` Subhash Jadavani
@ 2017-09-28 1:47 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-09-28 1:47 UTC (permalink / raw)
To: kehuanlin
Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-kernel, kehuanlin
kehuanlin,
> Since the command type of UTRD in UFS 2.1 specification is the same with
> UFS 2.0. And it assumes the future UFS specification will follow the same
> definition.
Applied to 4.15/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-28 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 9:58 [PATCH] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 kehuanlin
2017-09-26 21:50 ` Subhash Jadavani
2017-09-28 1:47 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.