[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190322161727.1153278-2-arnd@arndb.de>
Date: Fri, 22 Mar 2019 17:17:16 +0100
From: Arnd Bergmann <arnd@...db.de>
To: stable@...r.kernel.org, Vinayak Holikatti <vinholikatti@...il.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: kehuanlin <chgokhl@...il.com>, kehuanlin <kehuanlin@...econe.net>,
Subhash Jadavani <subhashj@...eaurora.org>,
Arnd Bergmann <arnd@...db.de>, Sasha Levin <sashal@...nel.org>,
Asutosh Das <asutoshd@...eaurora.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Maya Erez <merez@...eaurora.org>,
Sujit Reddy Thumma <sthumma@...eaurora.org>,
Stanley Chu <stanley.chu@...iatek.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [BACKPORT 4.14.y 1/8] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
From: kehuanlin <chgokhl@...il.com>
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@...econe.net>
Reviewed-by: Subhash Jadavani <subhashj@...eaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
(cherry picked from commit 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff)
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
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 66540491839e..581571de2461 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.20.0
Powered by blists - more mailing lists