]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.109/scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch
Linux 4.14.109
[thirdparty/kernel/stable-queue.git] / releases / 4.14.109 / scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch
CommitLineData
9e958b0b
GKH
1From 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff Mon Sep 17 00:00:00 2001
2From: kehuanlin <chgokhl@gmail.com>
3Date: Wed, 6 Sep 2017 17:58:39 +0800
4Subject: scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
5
6From: kehuanlin <chgokhl@gmail.com>
7
8commit 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff upstream.
9
10Since the command type of UTRD in UFS 2.1 specification is the same with
11UFS 2.0. And it assumes the future UFS specification will follow the
12same definition.
13
14Signed-off-by: kehuanlin <kehuanlin@pinecone.net>
15Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
16Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
17Signed-off-by: Arnd Bergmann <arnd@arndb.de>
18Signed-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,