Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3420125pxf; Mon, 29 Mar 2021 01:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBhNErAinrMSNdn2JrqA1I30VbdHrIb+snJz745WC1qz614kl9YxzW3Mz3mFV6C2BeRBZ7 X-Received: by 2002:a50:fd8b:: with SMTP id o11mr27203688edt.346.1617006715052; Mon, 29 Mar 2021 01:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006715; cv=none; d=google.com; s=arc-20160816; b=aBiv5kX1U+yCGqLMcAgO8RT/y247ra7vBcQxUx53WYdpgo7x6+ohVPNjRX7CgXgLXK VdOJHjmojqFSgdzVlUOtf11cge0uhSYaUpHcrCDSSb6QSv7dK+y3pIbE86T7q1N4dBLP nx8987qJ9euY7meSlO+ZjTpqmy2P9a1pUkqQxSgIE9/n8+Xl/9aajkvPJKqTD+YKw17J H9VpkPDSrFky1EUXbosa4fdTp8uXnoGmnImx7Qq1oPzXPpgGdysCZC83T4RwbNTMRiAV UuhemZftJqRWDcNELcHmWRmVvUYe4C3ZuHYNIL+2w/spkj57c5Z/T01dMTwD8z04KTal QLMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y5UDl4+7dFZwo6IQmfi8KsRMAbLMACebUf143ewzyUs=; b=DICS+f6SiEtyLa1NR9186G9Xi8O7f/xAftNs5z54oyhrS2CEZ1Y4lCFrbDvU3NyZJE zTcqYGCbCrXhDxZ0fQfcgGkjYzdJRjqbxV4Hkc47KCFgovQAQnEe2oTQPHq28jxKV8JJ dChPiONu7gy4xtiyW58eX56HCa1po9DsKsUkclS5QoqTinCfR5u6z2Pbv0eULNKFWVGN 8T99SC4L/LGiBcONTLxKUESkMVQ87+UMIaRxqDWW/wEMZq/JbFuhuCY14T3cEiboo4TT R9amqG4AEJ8czD2s4FIauWiNuI2zPU08lUHARZ/EC2JXVdlF0i4iqwYp8N7W9LTzPAA7 g85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdIUCICd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si11976639edc.137.2021.03.29.01.31.30; Mon, 29 Mar 2021 01:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fdIUCICd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233339AbhC2I0r (ORCPT + 99 others); Mon, 29 Mar 2021 04:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:58014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233206AbhC2IRJ (ORCPT ); Mon, 29 Mar 2021 04:17:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78620619C8; Mon, 29 Mar 2021 08:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005805; bh=F2Am5AgcwvHFfovPrzkmneKKrUDiOXkJDhQ6FIxVmD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdIUCICdO1oEQhpKQMoto0Ot2U251PL2HaLIoyvHUHIXQZLD0fEgKpGjGsv1M0HTl nAXsXFDCQYbRuGe0s2iCXpQzKGrmt55idrGHv8VhChyoyNfylFspz9rqvCxEQtXFWt cnfhghxgNPNtpl7DwaBJYySPWl5WGOm9EpCWkab0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Avri Altman , Nitin Rawat , Can Guo , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 012/221] scsi: ufs: ufs-qcom: Disable interrupt in reset path Date: Mon, 29 Mar 2021 09:55:43 +0200 Message-Id: <20210329075629.589757404@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nitin Rawat [ Upstream commit 4a791574a0ccf36eb3a0a46fbd71d2768df3eef9 ] 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 Signed-off-by: Nitin Rawat Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufs-qcom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index a244c8ae1b4e..20182e39cb28 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -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", @@ -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; } -- 2.30.1