From patchwork Fri May 28 03:36:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alice Chao X-Patchwork-Id: 12286141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00312C4707F for ; Fri, 28 May 2021 03:38:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1852611F0 for ; Fri, 28 May 2021 03:38:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235737AbhE1Dju (ORCPT ); Thu, 27 May 2021 23:39:50 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:60743 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229883AbhE1Djs (ORCPT ); Thu, 27 May 2021 23:39:48 -0400 X-UUID: 6dfea177829e4ed29ab4d5c3462afd56-20210528 X-UUID: 6dfea177829e4ed29ab4d5c3462afd56-20210528 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 216175521; Fri, 28 May 2021 11:38:11 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 11:38:07 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 28 May 2021 11:38:07 +0800 From: Alice To: , , , , , CC: , , , , , , , , Subject: [PATCH v2 2/2] scsi: ufs-mediatek: Disable HCI before HW reset Date: Fri, 28 May 2021 11:36:22 +0800 Message-ID: <20210528033624.12170-3-alice.chao@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210528033624.12170-1-alice.chao@mediatek.com> References: <20210528033624.12170-1-alice.chao@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: "Alice.Chao" MediaTek ufshci needs to be disabled before HW reset to avoid potential issues. Signed-off-by: Alice.Chao --- drivers/scsi/ufs/ufs-mediatek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index a981f261b304..c62603ed3d33 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -846,6 +846,9 @@ static int ufs_mtk_device_reset(struct ufs_hba *hba) { struct arm_smccc_res res; + /* disable hba before device reset */ + ufshcd_hba_stop(hba); + ufs_mtk_device_reset_ctrl(0, res); /*