Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11496016imu; Tue, 1 Jan 2019 00:20:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wq+tpZ8RFIMUl6QHzpBVqtCwRXGmhW6QEXUr6JbEISQg6bdfB40OTm+q5Emqs5ikf8VGql X-Received: by 2002:a62:4156:: with SMTP id o83mr40556750pfa.72.1546330800723; Tue, 01 Jan 2019 00:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546330800; cv=none; d=google.com; s=arc-20160816; b=HCd5rUX4WX+oHEN+B6RPMCznEaAp99mfodg2pt+oDb41GqpNe5WPqu0Wc2og727MDb wV0xjXDiLygtxd7EeX5B7vpTLS4EdrefR4oXECaHX38y2OlyvDfrI3yI2yjEH1rqs1y1 2p952YWKq37FFOhokELth/jPYOOjmkBlUS91fSoV++Dw0vdDX7ICUtEpM9uWCN5Rbgnc hIWJU3m588eKORDOLhZldPp21vkKOLiVjrA6nH3Kf7XPuj6HFsiPmHIhFyfbl2m9wgCM V99Uv6COngGvNyEiCNUj/NSu25Ep28CRn133fGXn7y8nsN2v5BuIreXOLgvX7T9fH+Uy FGXQ== 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=INcNyBh46sfmJM2Zwlch+VFZbTqWC3FD4NzZY4AWGUE=; b=Uj6uydS0CsQZ4Y9muEEwv1p9JUx2YeR9Fx4SXhzx9KhblGG/HE3qQGEI4oSn7fXUD7 9meUX/vKTqCVI62X5x/YwUDNefaj+dmAhPcq8eFrcx9ff57qCXCh+nHGdSgIQdP255OZ r2wN6CG1k35oSa6z+OArtGL+CBwcVP5Cr/xN3FECLYxbu/3mZTsglpduAIokVnzhbwI0 vg4WZqyJ32znSBG/Y617/4ZRxN9LgnU3UzzuhWon10rk1X80tKrSY8pWesm5vxPf8utA uoylkg1BhBvtdpLrEuHaZtk+f4h0Gx35TwtcPMfHEW047V9fkMwENKLDwkJ2B4XuLOkG FJug== 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 n5si46177323pgh.422.2019.01.01.00.19.44; Tue, 01 Jan 2019 00:20:00 -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 S1728434AbfAAEAB (ORCPT + 99 others); Mon, 31 Dec 2018 23:00:01 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:30211 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727417AbfAAEAB (ORCPT ); Mon, 31 Dec 2018 23:00:01 -0500 X-UUID: 09cdba4314004d378ca3c99d6ab3a3ea-20190101 X-UUID: 09cdba4314004d378ca3c99d6ab3a3ea-20190101 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 886063835; Tue, 01 Jan 2019 11:59:53 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 11:59:52 +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; Tue, 1 Jan 2019 11:59:51 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH v5 18/20] iommu/mediatek: Fix VLD_PA_RANGE register backup when suspend Date: Tue, 1 Jan 2019 11:55:50 +0800 Message-ID: <1546314952-15990-19-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> References: <1546314952-15990-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 --- 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 7fcef19..ddf1969 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -716,6 +716,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_range = readl_relaxed(base + REG_MMU_VLD_PA_RNG); clk_disable_unprepare(data->bclk); return 0; } @@ -740,6 +741,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_range, 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 0a7c463..c500bfd 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_range; }; enum mtk_iommu_plat { -- 1.9.1