* [RESEND PATCH v1 1/2] scsi: ufs: print helpful hint when response size exceed buffer size
@ 2019-11-12 0:21 Bean Huo (beanhuo)
2019-11-12 16:40 ` Bart Van Assche
0 siblings, 1 reply; 2+ messages in thread
From: Bean Huo (beanhuo) @ 2019-11-12 0:21 UTC (permalink / raw)
To: alim.akhtar, avri.altman, pedrom.sousa, jejb, martin.petersen,
stanley.chu, Bean Huo (beanhuo),
bvanassche, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
Bean Huo <beanhuo@micron.com>
Reset since ver.kernel.org rejected outlook.com.
Print out returned response size and buffer size, while the front one
is bigger than the back one.
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/scsi/ufs/ufshcd.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 11a87f51c442..fdb4f5b7f4bd 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1935,8 +1935,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
memcpy(hba->dev_cmd.query.descriptor, descp, resp_len);
} else {
dev_warn(hba->dev,
- "%s: Response size is bigger than buffer",
- __func__);
+ "%s: rsp size %d is bigger than buffer size %d",
+ __func__, resp_len, buf_len);
return -EINVAL;
}
}
@@ -5856,7 +5856,9 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
memcpy(desc_buff, descp, resp_len);
*buff_len = resp_len;
} 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;
err = -EINVAL;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND PATCH v1 1/2] scsi: ufs: print helpful hint when response size exceed buffer size
2019-11-12 0:21 [RESEND PATCH v1 1/2] scsi: ufs: print helpful hint when response size exceed buffer size Bean Huo (beanhuo)
@ 2019-11-12 16:40 ` Bart Van Assche
0 siblings, 0 replies; 2+ messages in thread
From: Bart Van Assche @ 2019-11-12 16:40 UTC (permalink / raw)
To: Bean Huo (beanhuo),
alim.akhtar, avri.altman, pedrom.sousa, jejb, martin.petersen,
stanley.chu, tomas.winkler, cang
Cc: linux-scsi, linux-kernel
On 11/11/19 4:21 PM, Bean Huo (beanhuo) wrote:
>
> Bean Huo <beanhuo@micron.com>
>
> Reset since ver.kernel.org rejected outlook.com.
> Print out returned response size and buffer size, while the front one
> is bigger than the back one.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
> drivers/scsi/ufs/ufshcd.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 11a87f51c442..fdb4f5b7f4bd 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1935,8 +1935,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> memcpy(hba->dev_cmd.query.descriptor, descp, resp_len);
> } else {
> dev_warn(hba->dev,
> - "%s: Response size is bigger than buffer",
> - __func__);
> + "%s: rsp size %d is bigger than buffer size %d",
> + __func__, resp_len, buf_len);
> return -EINVAL;
> }
> }
> @@ -5856,7 +5856,9 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
> memcpy(desc_buff, descp, resp_len);
> *buff_len = resp_len;
> } 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;
> err = -EINVAL;
> }
Hi Bean,
Please use git format-patch and/or git send-email to publish patches
such that the standard format is used ("From: " is missing from the
first line). Anyway:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-12 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 0:21 [RESEND PATCH v1 1/2] scsi: ufs: print helpful hint when response size exceed buffer size Bean Huo (beanhuo)
2019-11-12 16:40 ` Bart Van Assche
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).