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

Commit 7b4636ea authored by Nitin Rawat's avatar Nitin Rawat
Browse files

scsi: ufs: Disable interrupt in reset path



During error scenarios, while error handler is
in middle of resetting the host controller, we
might get a line reset which may result isr handler
trying to access UFS register. But since controller
is in reset state, SW won't have access to controller
register which will lead to noc error.

Change-Id: I5aab4dba1b12be9473bd91764307e16b7ef2f279
Signed-off-by: default avatarNitin Rawat <nitirawa@codeaurora.org>
parent 4afb6696
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -446,12 +446,17 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba)
{
	int ret = 0;
	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
	bool reenable_intr = false;

	if (!host->core_reset) {
		dev_warn(hba->dev, "%s: reset control not set\n", __func__);
		goto out;
	}

	reenable_intr = hba->is_irq_enabled;
	disable_irq(hba->irq);
	hba->is_irq_enabled = false;

	ret = reset_control_assert(host->core_reset);
	if (ret) {
		dev_err(hba->dev, "%s: core_reset assert failed, err = %d\n",
@@ -473,6 +478,11 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba)

	usleep_range(1000, 1100);

	if (reenable_intr) {
		enable_irq(hba->irq);
		hba->is_irq_enabled = true;
	}

out:
	return ret;
}