Skip to content

Commit

Permalink
scsi: ufs: core: Fix error return with query response
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bean Huo <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
sh043lee authored and martinkpetersen committed Feb 3, 2025
1 parent 87c4b5e commit 1a78a56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/ufs/core/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3104,8 +3104,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:
Expand Down

0 comments on commit 1a78a56

Please sign in to comment.