linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] UFS: Date Segment only need for WRITE DESCRIPTOR
@ 2016-08-25  9:39 Zang Leigang
  2016-09-27 22:30 ` subhashj
  0 siblings, 1 reply; 6+ messages in thread
From: Zang Leigang @ 2016-08-25  9:39 UTC (permalink / raw)
  To: vinholikatti, jejb, martin.petersen, linux-scsi, linux-kernel

Some device may cause a compatibility issue while receiving a Query UPIU
with Data Segment which does not expected.

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
---
 drivers/scsi/ufs/ufshcd.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index f08d41a..9b21d88 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1266,9 +1266,12 @@ static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
 	ucd_req_ptr->header.dword_1 = UPIU_HEADER_DWORD(
 			0, query->request.query_func, 0, 0);
 
-	/* Data segment length */
-	ucd_req_ptr->header.dword_2 = UPIU_HEADER_DWORD(
-			0, 0, len >> 8, (u8)len);
+	/* Data segment length only need for WRITE_DESC */
+	if (query->request.upiu_req.opcode == UPIU_QUERY_OPCODE_WRITE_DESC)
+		ucd_req_ptr->header.dword_2 =
+			UPIU_HEADER_DWORD(0, 0, (len >> 8), (u8)len);
+	else
+		ucd_req_ptr->header.dword_2 = 0;
 
 	/* Copy the Query Request buffer as is */
 	memcpy(&ucd_req_ptr->qr, &query->request.upiu_req,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-30  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25  9:39 [PATCH v2] UFS: Date Segment only need for WRITE DESCRIPTOR Zang Leigang
2016-09-27 22:30 ` subhashj
2016-09-28  5:14   ` Martin K. Petersen
2016-09-28  5:36     ` Kiwoong Kim
2016-09-30  1:36       ` Martin K. Petersen
2016-09-28 22:42     ` subhashj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).