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

Commit 8957d187 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan Committed by Can Guo
Browse files

scsi: ufs: handle LINERESET error only during hibern8 enter



If LINERESET was detected during hibern8 exit, HW recovers
link back to original speed automatically by PA_INIT sequence,
hence remove the full reset.

Change-Id: I181adf4580c0febed817047a40c1d0621d9c9824
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
[cang@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 20d3656b
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -4884,13 +4884,8 @@ int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
	trace_ufshcd_profile_hibern8(dev_name(hba->dev), "exit",
			     ktime_to_us(ktime_sub(ktime_get(), start)), ret);

	/*
	 * Do full reinit if exit failed or if LINERESET was detected during
	 * Hibern8 operation. After LINERESET, link moves to default PWM-G1
	 * mode hence full reinit is required to move link to HS speeds.
	 */
	if (ret || hba->full_init_linereset) {
		hba->full_init_linereset = false;
	/* Do full reinit if exit failed */
	if (ret) {
		ufshcd_update_error_stats(hba, UFS_ERR_HIBERN8_EXIT);
		dev_err(hba->dev, "%s: hibern8 exit failed. ret = %d\n",
			__func__, ret);
@@ -6624,14 +6619,16 @@ static irqreturn_t ufshcd_update_uic_error(struct ufs_hba *hba)
		dev_dbg(hba->dev, "%s: UIC Lane error reported\n", __func__);
		ufshcd_update_uic_reg_hist(&hba->ufs_stats.pa_err, reg);

		/* Don't ignore LINERESET indication during hibern8 operation */
		/*
		 * Don't ignore LINERESET indication during hibern8
		 * enter operation.
		 */
		if (reg & UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR) {
			struct uic_command *cmd = hba->active_uic_cmd;

			if (cmd) {
				if ((cmd->command == UIC_CMD_DME_HIBER_ENTER)
				 || (cmd->command == UIC_CMD_DME_HIBER_EXIT)) {
					dev_err(hba->dev, "%s: LINERESET during hibern8, reg 0x%x\n",
				if (cmd->command == UIC_CMD_DME_HIBER_ENTER) {
					dev_err(hba->dev, "%s: LINERESET during hibern8 enter, reg 0x%x\n",
						__func__, reg);
					hba->full_init_linereset = true;
				}