Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2744795pxj; Mon, 31 May 2021 09:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzrLNMreAnLzqNG915KtPWsENoUjQUFarJVJ3MsCjtjc3vy1QPH433Kfeh+/TIEqIQocMH X-Received: by 2002:a17:906:1f54:: with SMTP id d20mr23293646ejk.94.1622479146472; Mon, 31 May 2021 09:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479146; cv=none; d=google.com; s=arc-20160816; b=iLSzLAmOw4G0Esk0z7hFLpovsj5Q8fg1wTMgG363+3hiDgA6TzywZYhu3j97nRSpTg 6fO6xjf6URlHGGPNkXIg3j3HTu18vP0iFgpatj1nnOQ9UM4d6CVZpQBzKmmVonPZy9aT WW9dxuIqkQO05yLGa00dBPJexuXz0690419Dj5wZcrKqFxvCCVAmMH5MExeSJgN/AK7l HUM49V38xB8XXWmpJ/OMjlf3LfjbQbYhXYVsGnaYigezIA4KtunaE+FtbrLeyZouANzJ XESXZy9zBldK6Fw6axZeikufxkSTdcrbVKiWrl3T+bDYWHM9RtXn0kIDvte4kTGvemf/ tjbA== 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=RdtvT24y6SOhFJHSJ5XjxBK+UtG0Is1EPIku8xzWuAg=; b=IvfiHtubULgNYHx1u6p9YKNKMLBcvnbzXb+bZ/ZWrC9PoWU42tvnalJr3adRKixf7k 4L19WNgkU1rQcdS4ad0S3dI1t/9Aeis91zI+w+BM6iEAVwmjBHPadfDT+ptlkXS73/Jd djPWmxO7hoi6DigGgbleh4+uZD4ejWSIjRES3YKjG4Wi0jKXS+7Tvq+33F7S2dYtV3/a 3dZ07cOzVwtPtH/aK6k2n13NHw/ZcStaXJCbesD/TAIK2THnzVuIChn7TTyZoqAfZp/f 2kJ5Qa4cVcN7bKxX+wznULMaxU59CUkdFtci+DtjvOUHadyPoW+lmOmiWfRYipTf0Aym 5eMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MI2j11wS; 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 t26si12723947ejd.446.2021.05.31.09.38.43; Mon, 31 May 2021 09:39:06 -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=MI2j11wS; 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 S234642AbhEaQjR (ORCPT + 99 others); Mon, 31 May 2021 12:39:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232605AbhEaOuR (ORCPT ); Mon, 31 May 2021 10:50:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 04D5961C9A; Mon, 31 May 2021 13:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469450; bh=6J+VSZR2RVrPRUpwU04x1RUQWW0xg8KZLbMcUqkVw6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MI2j11wSB7lYbkpjhTtn6ghWW7k2Aijy/vGJbQJGKLIwFfT6isflK+AHwI7v7Qab1 hT295DufmtCqkG7t2FLkkGgL2CxI5xvulirUKDTG3LjkuabxwNJqWaSpcXT177zvSB dy7403ithckgaXXSgtx2xctcbnYijNANZ/KCeDmI= 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.12 201/296] scsi: ufs: ufs-mediatek: Fix power down spec violation Date: Mon, 31 May 2021 15:14:16 +0200 Message-Id: <20210531130710.641085795@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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 a981f261b304..aee3cfc7142a 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -922,6 +922,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); @@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) goto fail; } + if (ufshcd_is_link_off(hba)) + ufs_mtk_device_reset_ctrl(0, res); + return 0; fail: /* -- 2.30.2