Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp882124ybl; Wed, 21 Aug 2019 07:00:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/YWr48GtBjZLSAfsvTS9VfFOISDrhmq8EGCoySjq/XMOkut+ptQJWue2qRWTj13bzY278 X-Received: by 2002:a17:902:4643:: with SMTP id o61mr6619165pld.101.1566396058162; Wed, 21 Aug 2019 07:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566396058; cv=none; d=google.com; s=arc-20160816; b=PoCb3cUVKS+JNyvmzaCmlah/inzbAaqUpyZBDdDIua26D+RroOImKmh3hqnQ9ipfU4 GY9aWCYsMfM+ZbeA2DzVinZlV5lsSZeo+gF6fE3H7ZPcVJCG4pbJjRJ5QSBsuk0dNtqB Obv3/uhNpuz2v+78/HuM9PMnijXyKllZrtUP27mRKbHDch1Ld4geWMYavMxZr/Ei5j3n sy2pLaNTmdc6Mf+zgzYix+ahqE5goaa16mc6J9nZZcjWghaDsPD6ZoziM8CieBaZbNtF NwcwtP1EdbU/nuwNhH4P0kglM/L4VH088jT2KB7lICjUP/5l2WYKatnANR0pX3vZRypH umGg== 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=lnYICn2veCh15RoMUAvPUQ6vlOfUj7cKmP7f4Om6nAc=; b=KE8oZJ8ha7FRyY59umVFcsoYlwdf9d0dVz6OAOq3ZiYUSEW0NNPfsP1fyqVQQkzoyL dKdppyLXc6kcTSafCjwSoYuTZiZRp3jW6wMeHtvYyEO5KkmQCS1mq+b3NwhiLTzNLYdG RIrUUkJDaLNjwIXMRHXEGLSDks4WDw7/LyvwLVcaAHaD7IoR9DY/stJtEKbg71ED1e8I 999lS4AQAnjhdxnKWw6Lzw2OEjRW4h8/rdz5cex5l0e6lg5m7v/od2X5v89WgQlH2C3g Hid4E9fM2QTitN1RsIiyadJeuMxQtbpWD8tR9QyWOh0kWm1eWlamH3AJ9WNCq1xiWYeK AgPg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 130si14696834pgg.18.2019.08.21.07.00.41; Wed, 21 Aug 2019 07:00:58 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729358AbfHUN5b (ORCPT + 99 others); Wed, 21 Aug 2019 09:57:31 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:13787 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729018AbfHUN5b (ORCPT ); Wed, 21 Aug 2019 09:57:31 -0400 X-UUID: 5a3e935a700448efb4b85f43047ad900-20190821 X-UUID: 5a3e935a700448efb4b85f43047ad900-20190821 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 533225588; Wed, 21 Aug 2019 21:57:24 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 21 Aug 2019 21:57:21 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 21 Aug 2019 21:57:20 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Will Deacon CC: Rob Herring , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Matthias Kaehlcke , , , Subject: [PATCH v10 21/23] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend Date: Wed, 21 Aug 2019 21:53:24 +0800 Message-ID: <1566395606-7975-22-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566395606-7975-1-git-send-email-yong.wu@mediatek.com> References: <1566395606-7975-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 Reviewed-by: Matthias Brugger --- 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 470de8b..5d5341c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -742,6 +742,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; } @@ -766,6 +767,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 6b1f833..56b579c 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -24,6 +24,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