Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2669043pxj; Mon, 31 May 2021 07:51:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCripTMmD0tILlcYtQXU0c9hKg6NATZoa7K7+WV/+OwwPttMRQNP0AD4WRvghnOleYk93F X-Received: by 2002:a92:ca0a:: with SMTP id j10mr17524651ils.154.1622472714374; Mon, 31 May 2021 07:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622472714; cv=none; d=google.com; s=arc-20160816; b=JHLKqQW+zfsgyZEe5cxvkjuyOZiVzq51kh4RD76Y42tdkDbatDyiLxlyR54pkRAZH/ ZOR/JDn4h/93YJMDmq94wqN+CWBdeoD/W5Uf92mzbFvxAkjcDLEOafGeIZziW/mAvJ+C 16GujYc+3EQywVvZieU0MLG1Wy03RxLjzbKKPdTmPdIHaTq0amhIjC4ouPaf1T4BojLX cm14lu0ptXx0tbXUSmjgOhJcOA6U5SLymSms10S2tuiK3Uojhl0cQXebUUqtJ5PQ8Acf 1AEEaY9cxKB7hMHKBp7F/jgID7GSe6NU76scTwm1IUnoh4uI/06oXXOExSKUp2ZIh/Pl evGQ== 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=OAim3kJ2j/iWI+H6VoJKs0vRbHbwxwkHe2z+2sYVr7I=; b=f/5+9sXH3NZcHUBhwtl9t3gOTt0VG/UqU6rP0Zs5AXUa7fPufA+YgNwwNNLOzp0fKP BKe2q0h9wZSC6LnfIiWws7F6yX38bkYoZl5NpsD+z9/Y+rRqtegBgOeNTa6JekN6GuFY QTYCulkzuntpiervxVTH31+x01xOUQsyAUfI1cOEdV5DyOzsg7fhhyDhcI4xRyWi5Ea3 tUDOJ01dxW2LEwJucDFKBgTMcgboS84R9EgFZT0fqZr9LJ60Nyl/sslJBa8ZAkF7EFH5 HXZaf70BFbjUPIi1n7/yNRTKxnG2GKRC9ZQ/s9o4hPlwOSNczYj3ZXMEtPnw5vtJNxV+ aoSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DpSuzJ0S; 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 r14si15023687ila.121.2021.05.31.07.51.41; Mon, 31 May 2021 07:51:54 -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=DpSuzJ0S; 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 S232754AbhEaOwn (ORCPT + 99 others); Mon, 31 May 2021 10:52:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:38074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232210AbhEaOCy (ORCPT ); Mon, 31 May 2021 10:02:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7F7361396; Mon, 31 May 2021 13:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468246; bh=7+3A1Pukmv3Q1p12fd4IG939MkFyNpZf9mJ1LLh8o5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DpSuzJ0SPStRaJ75tQCw8dQ3NcYbu36gzfGRbzdCXgQAPxsWrIhSCdDj05N97f5sL 4GDnsB9UyV9nGZcZ/K2DUHbK0GMaosJEWlrNo0R6G92xsT747fxF412vIHYqecmFM8 vFwjFEbQaQUzxCzc04wJC3WIpxW/1h7niRwYad5w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanley Chu , Peter Wang , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 171/252] scsi: ufs: ufs-mediatek: Fix power down spec violation Date: Mon, 31 May 2021 15:13:56 +0200 Message-Id: <20210531130703.818410766@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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: Peter Wang [ Upstream commit c625b80b9d00f3546722cd77527f9697c8c4c911 ] As per spec, e.g. JESD220E chapter 7.2, while powering off the UFS device, RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2. The power down sequence after fixing: Power down: 1. Assert RST_N low 2. Turn-off VCC 3. Turn-off VCCQ/VCCQ2 Link: https://lore.kernel.org/r/1620813706-25331-1-git-send-email-peter.wang@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Peter Wang Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufs-mediatek.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index 09d2ac20508b..aace13399a7f 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -824,6 +824,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm) static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) { int err; + struct arm_smccc_res res; if (ufshcd_is_link_hibern8(hba)) { err = ufs_mtk_link_set_lpm(hba); @@ -844,6 +845,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufs_mtk_vreg_set_lpm(hba, true); } + if (ufshcd_is_link_off(hba)) + ufs_mtk_device_reset_ctrl(0, res); + return 0; } -- 2.30.2