Commit 3d4881d1 authored by Bean Huo's avatar Bean Huo Committed by Martin K. Petersen

scsi: ufs: print helpful hint when response size exceed buffer size

Print out returned response size and buffer size, while the front one is
bigger than the back one.

Link: https://lore.kernel.org/r/20191112223436.27449-2-huobean@gmail.comReviewed-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 964231aa
...@@ -1938,8 +1938,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) ...@@ -1938,8 +1938,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
memcpy(hba->dev_cmd.query.descriptor, descp, resp_len); memcpy(hba->dev_cmd.query.descriptor, descp, resp_len);
} else { } else {
dev_warn(hba->dev, dev_warn(hba->dev,
"%s: Response size is bigger than buffer", "%s: rsp size %d is bigger than buffer size %d",
__func__); __func__, resp_len, buf_len);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -5864,7 +5864,9 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, ...@@ -5864,7 +5864,9 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
memcpy(desc_buff, descp, resp_len); memcpy(desc_buff, descp, resp_len);
*buff_len = resp_len; *buff_len = resp_len;
} else { } else {
dev_warn(hba->dev, "rsp size is bigger than buffer"); dev_warn(hba->dev,
"%s: rsp size %d is bigger than buffer size %d",
__func__, resp_len, *buff_len);
*buff_len = 0; *buff_len = 0;
err = -EINVAL; err = -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment