Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1249365imj; Sun, 17 Feb 2019 01:18:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IZT6F+pInI4bPsWYVE9P/ye3pYrANfxYNyJ/hEYMY0VB3CkU61CPrIh7b/u/UG8qEQPsLAS X-Received: by 2002:a17:902:145:: with SMTP id 63mr19225197plb.256.1550395103092; Sun, 17 Feb 2019 01:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550395103; cv=none; d=google.com; s=arc-20160816; b=Iab8nSYPSdVAUSb01QzRdRNzIrbnpCCGS1F6hZYp7qbHqPrTQgmEHiK6wT4EZu5AHC 6Nh1ExCNxYZ/J6Whvly3DOhHV78VnkXOS47TGO9Yg/1nXtoGTnDOtRdyUBC5Z2xPJFZI VgrUvTfSfvpcVDFKSOTocNJisJZl2yo2iKZxoeYajCsc0Qobv8iY1SpnfHd+qpz2lr2p mAuhMq94AYuYc251kg8iKkLZE26GsHV7yzNPyheHdm7TWhMBP7M5RcQfp301Bnt6Co6/ SUOsIlQmz/PUuhSMbFI7RD2Mqj6/FoC8IsQeML1C6D2CCC9K5Pb1fgkORWJZUCR4mGHl L9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=9By8ykutgr6hZIIT6jECSP/mlXh0bqKLQ3KF/CjKRu4=; b=yX1TE5Ws4tvu7gkxAee0NfRIeTx3iq8lqKE77f8E8CKdeXt7WFK+g6Eug0h47oIO8G cRv7tEczC8s2c/lbiE62pBmlJgT1sLaSw+xUBEYAPDX5eHAzllydB8tEOUv+0K6rIoC6 IgFkMB+cbumcVKltYJfN6K2Ijupdrb36G01MZD4TOUxsWBaa6JoJBAaK5qYIZzikOMKp UoFRdAjirMuCWUQuwVYyW0xR+sxLJ1T42H+PJko5Uvh0awbCIKmRfI/F7lp9t/ZBbFrb p9jHU/dF1FTPsbmm1Q2w1e0vGNDENewcKoB7MwWZrpGqY/F7tyJmhN/ZyW3OhkkDoAFc cT0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si9369607pgu.560.2019.02.17.01.18.07; Sun, 17 Feb 2019 01:18:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727862AbfBQJJb (ORCPT + 99 others); Sun, 17 Feb 2019 04:09:31 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:35782 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727766AbfBQJJ3 (ORCPT ); Sun, 17 Feb 2019 04:09:29 -0500 X-UUID: 82b06576883244c5afd4a577cdd323c2-20190217 X-UUID: 82b06576883244c5afd4a577cdd323c2-20190217 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 948821970; Sun, 17 Feb 2019 17:09:22 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 17 Feb 2019 17:09:15 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sun, 17 Feb 2019 17:09:14 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Evan Green , Tomasz Figa , "Will Deacon" , , , , , , , , , , Nicolas Boichat , , Matthias Kaehlcke Subject: [PATCH v6 18/22] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend Date: Sun, 17 Feb 2019 17:04:56 +0800 Message-ID: <1550394300-17420-19-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550394300-17420-1-git-send-email-yong.wu@mediatek.com> References: <1550394300-17420-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: A7151B9DA4F9E89147C6CC1F4B871371515F1B8B8C1F48BB057BF6B44FC332782000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB mode support for mt2712. this patch add it. Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 2 ++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 22c508b..b02854c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -715,6 +715,7 @@ static int __maybe_unused mtk_iommu_suspend(struct device *dev) reg->int_control0 = readl_relaxed(base + REG_MMU_INT_CONTROL0); reg->int_main_control = readl_relaxed(base + REG_MMU_INT_MAIN_CONTROL); reg->ivrp_paddr = readl_relaxed(base + REG_MMU_IVRP_PADDR); + reg->vld_pa_rng = readl_relaxed(base + REG_MMU_VLD_PA_RNG); clk_disable_unprepare(data->bclk); return 0; } @@ -739,6 +740,7 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) writel_relaxed(reg->int_control0, base + REG_MMU_INT_CONTROL0); writel_relaxed(reg->int_main_control, base + REG_MMU_INT_MAIN_CONTROL); writel_relaxed(reg->ivrp_paddr, base + REG_MMU_IVRP_PADDR); + writel_relaxed(reg->vld_pa_rng, base + REG_MMU_VLD_PA_RNG); if (m4u_dom) writel(m4u_dom->cfg.arm_v7s_cfg.ttbr[0] & MMU_PT_ADDR_MASK, base + REG_MMU_PT_BASE_ADDR); diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index db12424..dedf05c 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -33,6 +33,7 @@ struct mtk_iommu_suspend_reg { u32 int_control0; u32 int_main_control; u32 ivrp_paddr; + u32 vld_pa_rng; }; enum mtk_iommu_plat { -- 1.9.1