]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: core: Fix error return with query response
authorSeunghui Lee <sh043.lee@samsung.com>
Sat, 18 Jan 2025 02:38:08 +0000 (11:38 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:15 +0000 (12:54 -0700)
[ Upstream commit 1a78a56ea65252bb089e0daace989167227f2d31 ]

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>
Link: https://lore.kernel.org/r/20250118023808.24726-1-sh043.lee@samsung.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/core/ufshcd.c

index a3e95ef5eda82e165385912f84c7f5b9dc1a867d..89fc0b5662919b875833348a7511760978377c06 100644 (file)
@@ -3138,8 +3138,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: