Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1435067ybl; Fri, 23 Aug 2019 20:22:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXd6sXFJyJBZJkBXewIU7t915MIc5kQaDiR2BKzZ2vXGCdt4UuLIblhnh0JTMsA50ufj3Z X-Received: by 2002:a17:90a:dac3:: with SMTP id g3mr8440931pjx.45.1566616974180; Fri, 23 Aug 2019 20:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566616974; cv=none; d=google.com; s=arc-20160816; b=rV059Hj/m68K/RC01vOTJq/2m423dnSXOd52IpyCIEk10+iGvcJxhGFIJDbzxc4SzM pVOoUkkzIdrJhLrmzLiog2EEOfjL8jg8WfRrD4MXVciXvX33p++isvS5XWscsHq/LUqw vgEKWxl+VrBjgykaXejJPPJeyW8HmoKU8S9yTlh5ezKAYl8V9e4LB+IkwlcaiOF3sVMp MftjBdBM6lVoC6q3dCWxqK/hS9N+/x0U/HI4pfQK4WR4q59cxF+F6tB8TNoMdsr0gWnW 8a3hrUD+p9il48Sb24eGTTUOuXGk4BG1gJKPQMyz1/HjN810viFqEDG2HMNOCzCAA+Nt zhYQ== 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=dFybixQKP/gDMu53UccZ1o+RHtxdCutYQLz1V+NFoszenTI7rmx6i3/vMvH9jUjRvo 8XQbkpacIU3RPs1YSotB2rcW+zQrKLo+WWHvVkdlyt/dwzyd557Q9cViqRVIts4zel8b SDytAdM2qZppLZnSVnbUidoCLkQTuR6kALoGK7tL5TS0UXhXKO3Tvh6J+GGEYyjb/Vtv Kl38x/9ukEmbxNykn7Aa/vPi3C7Xl5iTV9QReZSsitaARY44fvebwZsnVqdj1O8TmSAq 2TRYUVKGJBJAui9JbGezxbY+WY6V4aTeb2qHbx4ZF3hYyxRoaArNn0N8Wpa2WzrYZ/jy JL9g== 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 a3si4109842pla.117.2019.08.23.20.22.38; Fri, 23 Aug 2019 20:22:54 -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 S1726520AbfHXDVh (ORCPT + 99 others); Fri, 23 Aug 2019 23:21:37 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:57301 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725782AbfHXDVh (ORCPT ); Fri, 23 Aug 2019 23:21:37 -0400 X-UUID: c0d77b2941dd40dcb855e1276ae0dffc-20190824 X-UUID: c0d77b2941dd40dcb855e1276ae0dffc-20190824 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0707 with TLS) with ESMTP id 772859647; Sat, 24 Aug 2019 11:06:51 +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; Sat, 24 Aug 2019 11:06:43 +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; Sat, 24 Aug 2019 11:06:42 +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 v11 21/23] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend Date: Sat, 24 Aug 2019 11:02:06 +0800 Message-ID: <1566615728-26388-22-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566615728-26388-1-git-send-email-yong.wu@mediatek.com> References: <1566615728-26388-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