From: Bean Huo <huobean@gmail.com>
To: Seunghui Lee <sh043.lee@samsung.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: ufs: core: Fix error return with query response
Date: Fri, 17 Jan 2025 11:47:06 +0100 [thread overview]
Message-ID: <478fd574de9b6059061ea9112aea2c1542c61b59.camel@gmail.com> (raw)
In-Reply-To: <20250117071600.19369-1-sh043.lee@samsung.com>
On Fri, 2025-01-17 at 16:16 +0900, Seunghui Lee wrote:
> There is currently no mechanism to return error from query responses.
> Return the error and print the corresponding error message with it.
>
> Signed-off-by: Seunghui Lee <sh043.lee@samsung.com>
> ---
> drivers/ufs/core/ufshcd.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 9c26e8767515..6b27ea1a7a1b 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -3118,8 +3118,13 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba,
> struct ufshcd_lrb *lrbp)
> case UPIU_TRANSACTION_QUERY_RSP: {
> u8 response = lrbp->ucd_rsp_ptr->header.response;
>
> - if (response == 0)
> + if (response == 0) {
> err = ufshcd_copy_query_response(hba, lrbp);
> + } else {
> + err = -EINVAL;
> + dev_err(hba->dev, "%s: unexpected response
> %x\n",
> + __func__, resp);
> + }
> break;
> }
> case UPIU_TRANSACTION_REJECT_UPIU:
There is a confusing mix of UPIU transaction code and response in UPIU
here, I think you want to print "response" instead of transaction code.
dev_err(hba->dev, "%s: Unexpected response in Query RSP: %x\n",
__func__, response);
next prev parent reply other threads:[~2025-01-17 10:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250117071604epcas1p44c7f7898b826ad8762cfdd79aa31bbf5@epcas1p4.samsung.com>
2025-01-17 7:16 ` [PATCH] scsi: ufs: core: Fix error return with query response Seunghui Lee
2025-01-17 10:47 ` Bean Huo [this message]
2025-01-18 2:16 ` 이승희
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=478fd574de9b6059061ea9112aea2c1542c61b59.camel@gmail.com \
--to=huobean@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=sh043.lee@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox