UPSTREAM: scsi: ufs: core: Fix error return with query response

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>

Bug: 404731793
Change-Id: I9d4cc29635e011dcd9b486f3e258425334b69eac
(cherry picked from commit 1a78a56ea65252bb089e0daace989167227f2d31)
Signed-off-by: Rui Chen <chenrui9@honor.com>
This commit is contained in:
Seunghui Lee
2025-01-18 11:38:08 +09:00
committed by Treehugger Robot
parent 6bf1e3e582
commit 12cbb992b4
+6 -1
View File
@@ -3202,8 +3202,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: