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

Commit 8d765278 authored by Sayali Lokhande's avatar Sayali Lokhande
Browse files

scsi: ufs: Crash the system on unrecoverable state



If we hit fatal errors and are not able to recover using
reset, crash the system instead of proceeding and causing
further system failures.

Change-Id: I7fa3ea9d862f55330eea290a192028c11d5ddbde
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 84a47e8c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7150,6 +7150,12 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba)
		err = ufshcd_detect_device(hba);
	} while (err && --retries);

	/*
	 * There is no point proceeding even after failing
	 * to recover after multiple retries.
	 */
	if (err && ufshcd_is_embedded_dev(hba))
		BUG();
	/*
	 * After reset the door-bell might be cleared, complete
	 * outstanding requests in s/w here.
+8 −0
Original line number Diff line number Diff line
@@ -1198,6 +1198,14 @@ static inline bool ufshcd_is_hs_mode(struct ufs_pa_layer_attr *pwr_info)
		pwr_info->pwr_tx == FASTAUTO_MODE);
}

static inline bool ufshcd_is_embedded_dev(struct ufs_hba *hba)
{
	if ((hba->dev_info.b_device_sub_class == UFS_DEV_EMBEDDED_BOOTABLE) ||
	    (hba->dev_info.b_device_sub_class == UFS_DEV_EMBEDDED_NON_BOOTABLE))
		return true;
	return false;
}

#ifdef CONFIG_DEBUG_FS
static inline void ufshcd_init_req_stats(struct ufs_hba *hba)
{