From 74cf8b55c33ffc17e7beb3d181c1c392bb6d1655 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 13:14:44 +0900 Subject: [PATCH] scsi: ufs: fix data segment length for upiu header Change-Id: I3f1c16422c32809390c83dc4391f396b9e9b0ad6 Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3983c38cbf4f..7df4c38ecdfe 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2221,6 +2221,9 @@ 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); + if (query->request.upiu_req.opcode == UPIU_QUERY_OPCODE_READ_DESC) + len = 0; + /* 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 = -- 2.20.1