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

Commit 9bd9c9ba authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma
Browse files

scsi: ufs: retry if host reset fails



SCSI error handling mechanism offlines the device if the host
reset fails and the device is never recovered until a reboot.
Hence, instead of giving up on first host reset failure, retry
few more times to see if the link can be recovered.

Change-Id: I16d5c16b34f691135feb8cce0ec20520573011b9
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
parent bfc96c5e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@
/* maximum number of link-startup retries */
#define DME_LINKSTARTUP_RETRIES 3

/* maximum number of reset retries before giving up */
#define MAX_HOST_RESET_RETRIES 5

/* Expose the flag value from utp_upiu_query.value */
#define MASK_QUERY_UPIU_FLAG_LOC 0xFF

@@ -3592,8 +3595,11 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba)
{
	int err = 0;
	unsigned long flags;
	int retries = MAX_HOST_RESET_RETRIES;

	do {
		err = ufshcd_host_reset_and_restore(hba);
	} while (err && --retries);

	/*
	 * After reset the door-bell might be cleared, complete