Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a729df2 authored by Gilad Broner's avatar Gilad Broner Committed by Subhash Jadavani
Browse files

scsi: ufs: add SCSI status error code print



To assist debugging, print the SCSI status code of response UPIU
in case it suggests error condition.

Change-Id: If01a80ee1004af2127b7639e0c43e1e6812864ee
Signed-off-by: default avatarGilad Broner <gbroner@codeaurora.org>
parent 27475f8c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -4476,7 +4476,8 @@ static int ufshcd_task_req_compl(struct ufs_hba *hba, u32 index, u8 *resp)
 * Returns value base on SCSI command status
 */
static inline int
ufshcd_scsi_cmd_status(struct ufshcd_lrb *lrbp, int scsi_status)
ufshcd_scsi_cmd_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
	int scsi_status)
{
	int result = 0;

@@ -4499,6 +4500,11 @@ ufshcd_scsi_cmd_status(struct ufshcd_lrb *lrbp, int scsi_status)
		break;
	} /* end of switch */

	if (scsi_status != SAM_STAT_GOOD)
		dev_err(hba->dev,
			"SCSI cmd opcode: 0x%x status error: 0x%x, result: 0x%x\n",
			lrbp->cmd->cmnd[0], scsi_status, result);

	return result;
}

@@ -4537,7 +4543,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
			 * to notify the SCSI midlayer of the command status
			 */
			scsi_status = result & MASK_SCSI_STATUS;
			result = ufshcd_scsi_cmd_status(lrbp, scsi_status);
			result = ufshcd_scsi_cmd_status(hba, lrbp, scsi_status);

			if (ufshcd_is_exception_event(lrbp->ucd_rsp_ptr))
				schedule_work(&hba->eeh_work);