Skip to content

Commit

Permalink
scsi: ufs: ufs-qcom: Disable interrupt in reset path
Browse files Browse the repository at this point in the history
Disable interrupt in reset path to flush pending IRQ handler in order to
avoid possible NoC issues.

Link: https://lore.kernel.org/r/1614145010-36079-3-git-send-email-cang@codeaurora.org
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Nitin Rawat authored and Martin K. Petersen committed Mar 4, 2021
1 parent aa53f58 commit 4a79157
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/scsi/ufs/ufs-qcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,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",
Expand All @@ -280,6 +285,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;
}
Expand Down

0 comments on commit 4a79157

Please sign in to comment.