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

Commit cfeb0be9 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Can Guo
Browse files

scsi: ufs: add link lost error status detection



If UIC_LINK_LOST error is detected, reinitialize the link again.

Change-Id: Icfcca65c39a1bd13fea9fff8d70c21560d00101f
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 463d8c28
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -6353,7 +6353,7 @@ static void ufshcd_err_handler(struct work_struct *work)
	 * Dump controller state before resetting. Transfer requests state
	 * Dump controller state before resetting. Transfer requests state
	 * will be dump as part of the request completion.
	 * will be dump as part of the request completion.
	 */
	 */
	if ((hba->saved_err & (INT_FATAL_ERRORS | UIC_ERROR)) ||
	if ((hba->saved_err & (INT_FATAL_ERRORS | UIC_ERROR | UIC_LINK_LOST)) ||
	    hba->auto_h8_err) {
	    hba->auto_h8_err) {
		dev_err(hba->dev, "%s: saved_err 0x%x saved_uic_err 0x%x",
		dev_err(hba->dev, "%s: saved_err 0x%x saved_uic_err 0x%x",
			__func__, hba->saved_err, hba->saved_uic_err);
			__func__, hba->saved_err, hba->saved_uic_err);
@@ -6370,7 +6370,7 @@ static void ufshcd_err_handler(struct work_struct *work)
		hba->auto_h8_err = false;
		hba->auto_h8_err = false;
	}
	}


	if ((hba->saved_err & INT_FATAL_ERRORS)
	if ((hba->saved_err & (INT_FATAL_ERRORS | UIC_LINK_LOST))
	    || hba->saved_ce_err || hba->force_host_reset ||
	    || hba->saved_ce_err || hba->force_host_reset ||
	    ((hba->saved_err & UIC_ERROR) &&
	    ((hba->saved_err & UIC_ERROR) &&
	    (hba->saved_uic_err & (UFSHCD_UIC_DL_PA_INIT_ERROR |
	    (hba->saved_uic_err & (UFSHCD_UIC_DL_PA_INIT_ERROR |
@@ -6649,6 +6649,12 @@ static irqreturn_t ufshcd_check_errors(struct ufs_hba *hba)
	if (hba->errors & INT_FATAL_ERRORS || hba->ce_error)
	if (hba->errors & INT_FATAL_ERRORS || hba->ce_error)
		queue_eh_work = true;
		queue_eh_work = true;


	if (hba->errors & UIC_LINK_LOST) {
		dev_err(hba->dev, "%s: UIC_LINK_LOST received, errors 0x%x\n",
					__func__, hba->errors);
		queue_eh_work = true;
	}

	if (hba->errors & UIC_ERROR) {
	if (hba->errors & UIC_ERROR) {
		hba->uic_error = 0;
		hba->uic_error = 0;
		retval = ufshcd_update_uic_error(hba);
		retval = ufshcd_update_uic_error(hba);
+1 −1
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ enum {


#define UFSHCD_UIC_MASK		(UIC_COMMAND_COMPL | UFSHCD_UIC_PWR_MASK)
#define UFSHCD_UIC_MASK		(UIC_COMMAND_COMPL | UFSHCD_UIC_PWR_MASK)


#define UFSHCD_ERROR_MASK	(UIC_ERROR |\
#define UFSHCD_ERROR_MASK	(UIC_ERROR | UIC_LINK_LOST |\
				DEVICE_FATAL_ERROR |\
				DEVICE_FATAL_ERROR |\
				CONTROLLER_FATAL_ERROR |\
				CONTROLLER_FATAL_ERROR |\
				SYSTEM_BUS_FATAL_ERROR |\
				SYSTEM_BUS_FATAL_ERROR |\