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

Commit 8363cb94 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix race b/w resume and err_handler"

parents dd307c00 ba2a4ddd
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -10558,10 +10558,21 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
	ufshcd_wb_buf_flush_disable(hba);
	if (!ufshcd_is_ufs_dev_active(hba)) {
		ret = ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE);
		if (ret)
		if (ret) {
			/*
			 * In the case of SSU timeout, err_handler must have
			 * recovered the uic link and dev state to active so
			 * we can proceed after checking the link and
			 * dev state.
			 */
			if ((host_byte(ret) == DID_TIME_OUT) &&
			    ufshcd_is_ufs_dev_active(hba) &&
			    ufshcd_is_link_active(hba))
				ret = 0;
			else
				goto set_old_link_state;
		}

	}
	if (ufshcd_keep_autobkops_enabled_except_suspend(hba))
		ufshcd_enable_auto_bkops(hba);
	else