Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3150253ybi; Mon, 10 Jun 2019 05:24:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMRVRWvffCGg17rDx19DFZnuBMfBzO6wrrab9aUtUSCEo2DUqgDVfL0dzuDmFHpJPlk0cv X-Received: by 2002:a17:902:7c8e:: with SMTP id y14mr2368030pll.298.1560169474070; Mon, 10 Jun 2019 05:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560169474; cv=none; d=google.com; s=arc-20160816; b=EJz8VXaNqAwNuTCiEKOS7KqlgGHyRGuhI3BZm0Zg7lkyf7iqewTjzsMUH26DYvST0h uX2dzD0fWaXyMRL0RJYYbxLBMiKG6uYh/i3/3zvDc+vdSw5oqY940SNJkCCuR49uv1Cq GLEPMBMvAj9mOAR3YZXNBO6OCGPsL6NbfOMl44S8ArNntxxd+JgclgmtwRVeSHf+jyCJ t1QMjgkZZzm3C4XqQXrIVMiD3JxTytwNf84UU0Shdbk9e0VgTO92Y6zmO1xB29gXmAI9 LJ5fz1XhvdLcHX7d9aOMRQTh6YyCT0JJKHE2eBmlPa2XAKc1v3Ga/SeLhc67uzz3KzdF sd8A== 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=tB86K+qdMNOzEIPezMRqGvMCtpXCTqGZgn2M2W2MwE0=; b=umdrPqN7fA/nCbQgXpb5Uf48Q10OOccaVkS1MlF6HdwkG0IwWon9edUHlV83CIJZSM UhYY6GoBlydJ/NIf5uDmdMohHNh+QDdR9ffWw9fEu2czaxlGSxvDNH/5xORAVgxBi/Et idCtCG3dAetBw42GFDeE1q4PEq7KEoM2SZPb2zDeLmeink+4CEnpP4AXCds+ypw1yFVz TzB9/ZCGDOwZmP3+MnsXdIBb1cnViV+6ojmdNDjNwKiFMMD+jzozw9lId4p4ojWBb+DI gX8Uz16ck3SKPFInvtJUaZtRhg4sdydQI3LJkrBWRADeGuKIAn3HjRt/AwID8v7ULhtF LOZg== 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 i11si9205177plt.92.2019.06.10.05.24.19; Mon, 10 Jun 2019 05:24:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390021AbfFJMWB (ORCPT + 99 others); Mon, 10 Jun 2019 08:22:01 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36383 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389705AbfFJMWB (ORCPT ); Mon, 10 Jun 2019 08:22:01 -0400 X-UUID: ae77cbbab0ef45a49061087672f3d325-20190610 X-UUID: ae77cbbab0ef45a49061087672f3d325-20190610 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1304664114; Mon, 10 Jun 2019 20:21:55 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 20:21:54 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 10 Jun 2019 20:21:53 +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 v7 18/21] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend Date: Mon, 10 Jun 2019 20:17:57 +0800 Message-ID: <1560169080-27134-19-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560169080-27134-1-git-send-email-yong.wu@mediatek.com> References: <1560169080-27134-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 --- 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 6053b8b..86158d8 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -719,6 +719,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; } @@ -743,6 +744,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 c0b5c65..753266b 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -32,6 +32,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