public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi: ufs: core: Fix error return with query response
       [not found] <CGME20250118023817epcas1p1a7cb68709776f01c5ebeeb02908ed157@epcas1p1.samsung.com>
@ 2025-01-18  2:38 ` Seunghui Lee
  2025-01-21 13:10   ` Bean Huo
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Seunghui Lee @ 2025-01-18  2:38 UTC (permalink / raw)
  To: linux-scsi; +Cc: Seunghui Lee

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>
---
Changes to v1:
- modify the error message with response in UPIU(Bean Huo's suggestion)
---
 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..97e50bccb95c 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 in Query RSP: %x\n",
+					__func__, response);
+		}
 		break;
 	}
 	case UPIU_TRANSACTION_REJECT_UPIU:
-- 
2.43.0


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

* Re: [PATCH v2] scsi: ufs: core: Fix error return with query response
  2025-01-18  2:38 ` [PATCH v2] scsi: ufs: core: Fix error return with query response Seunghui Lee
@ 2025-01-21 13:10   ` Bean Huo
  2025-01-21 18:23   ` Bart Van Assche
  2025-02-04  3:33   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bean Huo @ 2025-01-21 13:10 UTC (permalink / raw)
  To: Seunghui Lee, linux-scsi, bvanassche, martin.petersen,
	Avri.Altman

On Sat, 2025-01-18 at 11:38 +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>

you need cc to all of UFS stack developers, then your patch could get a
quick review, not only just sent to scsi maillist:


Reviewed-by: Bean Huo <beanhuo@micron.com>

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

* Re: [PATCH v2] scsi: ufs: core: Fix error return with query response
  2025-01-18  2:38 ` [PATCH v2] scsi: ufs: core: Fix error return with query response Seunghui Lee
  2025-01-21 13:10   ` Bean Huo
@ 2025-01-21 18:23   ` Bart Van Assche
  2025-02-04  3:33   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-01-21 18:23 UTC (permalink / raw)
  To: Seunghui Lee, linux-scsi, Bean Huo

On 1/17/25 6:38 PM, 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>
> ---
> Changes to v1:
> - modify the error message with response in UPIU(Bean Huo's suggestion)
> ---
>   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..97e50bccb95c 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 in Query RSP: %x\n",
> +					__func__, response);
> +		}
>   		break;
>   	}
>   	case UPIU_TRANSACTION_REJECT_UPIU:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH v2] scsi: ufs: core: Fix error return with query response
  2025-01-18  2:38 ` [PATCH v2] scsi: ufs: core: Fix error return with query response Seunghui Lee
  2025-01-21 13:10   ` Bean Huo
  2025-01-21 18:23   ` Bart Van Assche
@ 2025-02-04  3:33   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-02-04  3:33 UTC (permalink / raw)
  To: linux-scsi, Seunghui Lee; +Cc: Martin K . Petersen

On Sat, 18 Jan 2025 11:38:08 +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.
> 
> 

Applied to 6.14/scsi-fixes, thanks!

[1/1] scsi: ufs: core: Fix error return with query response
      https://git.kernel.org/mkp/scsi/c/1a78a56ea652

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2025-02-04  3:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20250118023817epcas1p1a7cb68709776f01c5ebeeb02908ed157@epcas1p1.samsung.com>
2025-01-18  2:38 ` [PATCH v2] scsi: ufs: core: Fix error return with query response Seunghui Lee
2025-01-21 13:10   ` Bean Huo
2025-01-21 18:23   ` Bart Van Assche
2025-02-04  3:33   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox