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

Unverified Commit 1d8adc37 authored by Nitin Rawat's avatar Nitin Rawat Committed by Michael Bestas
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 5aecb90d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -910,6 +910,7 @@ static int ufs_qcom_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
static int ufs_qcom_full_reset(struct ufs_hba *hba)
{
	int ret = -ENOTSUPP;
	bool reenable_intr = false;

	if (!hba->core_reset) {
		dev_err(hba->dev, "%s: failed, err = %d\n", __func__,
@@ -917,6 +918,10 @@ static int ufs_qcom_full_reset(struct ufs_hba *hba)
		goto out;
	}

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

	ret = reset_control_assert(hba->core_reset);
	if (ret) {
		dev_err(hba->dev, "%s: core_reset assert failed, err = %d\n",
@@ -936,6 +941,11 @@ static int ufs_qcom_full_reset(struct ufs_hba *hba)
		dev_err(hba->dev, "%s: core_reset deassert failed, err = %d\n",
				__func__, ret);

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

out:
	return ret;
}