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

Commit 6728c138 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix error handing during hibern8 enter"

parents 66f971f3 a115b29a
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -4289,15 +4289,25 @@ static int __ufshcd_uic_hibern8_enter(struct ufs_hba *hba)
	 * mode hence full reinit is required to move link to HS speeds.
	 * mode hence full reinit is required to move link to HS speeds.
	 */
	 */
	if (ret || hba->full_init_linereset) {
	if (ret || hba->full_init_linereset) {
		int err;

		hba->full_init_linereset = false;
		hba->full_init_linereset = false;
		ufshcd_update_error_stats(hba, UFS_ERR_HIBERN8_ENTER);
		ufshcd_update_error_stats(hba, UFS_ERR_HIBERN8_ENTER);
		dev_err(hba->dev, "%s: hibern8 enter failed. ret = %d",
		dev_err(hba->dev, "%s: hibern8 enter failed. ret = %d",
			__func__, ret);
			__func__, ret);
		/*
		/*
		 * If link recovery fails then return error so that caller
		 * If link recovery fails then return error code (-ENOLINK)
		 * don't retry the hibern8 enter again.
		 * returned ufshcd_link_recovery().
		 * If link recovery succeeds then return -EAGAIN to attempt
		 * hibern8 enter retry again.
		 */
		 */
		ret = ufshcd_link_recovery(hba);
		err = ufshcd_link_recovery(hba);
		if (err) {
			dev_err(hba->dev, "%s: link recovery failed", __func__);
			ret = err;
		} else {
			ret = -EAGAIN;
		}
	} else {
	} else {
		dev_dbg(hba->dev, "%s: Hibern8 Enter at %lld us", __func__,
		dev_dbg(hba->dev, "%s: Hibern8 Enter at %lld us", __func__,
			ktime_to_us(ktime_get()));
			ktime_to_us(ktime_get()));
@@ -4314,8 +4324,8 @@ int ufshcd_uic_hibern8_enter(struct ufs_hba *hba)
		ret = __ufshcd_uic_hibern8_enter(hba);
		ret = __ufshcd_uic_hibern8_enter(hba);
		if (!ret)
		if (!ret)
			goto out;
			goto out;
		else if (ret != -EAGAIN)
			/* Unable to recover the link, so no point proceeding */
			/* Unable to recover the link, so no point proceeding */
		 if (ret == -ENOLINK)
			BUG();
			BUG();
	}
	}
out:
out: