Skip to content

Commit 1a78a56

Browse files
sh043leemartinkpetersen
authored andcommitted
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>
1 parent 87c4b5e commit 1a78a56

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3104,8 +3104,13 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
31043104
case UPIU_TRANSACTION_QUERY_RSP: {
31053105
u8 response = lrbp->ucd_rsp_ptr->header.response;
31063106

3107-
if (response == 0)
3107+
if (response == 0) {
31083108
err = ufshcd_copy_query_response(hba, lrbp);
3109+
} else {
3110+
err = -EINVAL;
3111+
dev_err(hba->dev, "%s: unexpected response in Query RSP: %x\n",
3112+
__func__, response);
3113+
}
31093114
break;
31103115
}
31113116
case UPIU_TRANSACTION_REJECT_UPIU:

0 commit comments

Comments
 (0)