]>
Commit | Line | Data |
---|---|---|
9e958b0b GKH |
1 | From 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff Mon Sep 17 00:00:00 2001 |
2 | From: kehuanlin <chgokhl@gmail.com> | |
3 | Date: Wed, 6 Sep 2017 17:58:39 +0800 | |
4 | Subject: scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 | |
5 | ||
6 | From: kehuanlin <chgokhl@gmail.com> | |
7 | ||
8 | commit 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff upstream. | |
9 | ||
10 | Since the command type of UTRD in UFS 2.1 specification is the same with | |
11 | UFS 2.0. And it assumes the future UFS specification will follow the | |
12 | same definition. | |
13 | ||
14 | Signed-off-by: kehuanlin <kehuanlin@pinecone.net> | |
15 | Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> | |
16 | Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> | |
17 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/scsi/ufs/ufshcd.c | 14 ++++++++------ | |
22 | 1 file changed, 8 insertions(+), 6 deletions(-) | |
23 | ||
24 | --- a/drivers/scsi/ufs/ufshcd.c | |
25 | +++ b/drivers/scsi/ufs/ufshcd.c | |
26 | @@ -2195,10 +2195,11 @@ static int ufshcd_comp_devman_upiu(struc | |
27 | u32 upiu_flags; | |
28 | int ret = 0; | |
29 | ||
30 | - if (hba->ufs_version == UFSHCI_VERSION_20) | |
31 | - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; | |
32 | - else | |
33 | + if ((hba->ufs_version == UFSHCI_VERSION_10) || | |
34 | + (hba->ufs_version == UFSHCI_VERSION_11)) | |
35 | lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE; | |
36 | + else | |
37 | + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; | |
38 | ||
39 | ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE); | |
40 | if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY) | |
41 | @@ -2222,10 +2223,11 @@ static int ufshcd_comp_scsi_upiu(struct | |
42 | u32 upiu_flags; | |
43 | int ret = 0; | |
44 | ||
45 | - if (hba->ufs_version == UFSHCI_VERSION_20) | |
46 | - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; | |
47 | - else | |
48 | + if ((hba->ufs_version == UFSHCI_VERSION_10) || | |
49 | + (hba->ufs_version == UFSHCI_VERSION_11)) | |
50 | lrbp->command_type = UTP_CMD_TYPE_SCSI; | |
51 | + else | |
52 | + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; | |
53 | ||
54 | if (likely(lrbp->cmd)) { | |
55 | ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, |