Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1491804imu; Sat, 8 Dec 2018 00:45:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VvIjm85fkqSUx+4YOXA/GwAxP79Feu2hWsOTZOT9f+KfPDkeCTpzTCjSDDsCyjTkLV4E2f X-Received: by 2002:a17:902:28aa:: with SMTP id f39mr5072912plb.297.1544258750560; Sat, 08 Dec 2018 00:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544258750; cv=none; d=google.com; s=arc-20160816; b=hiB/2Zs9Zap69aMzIGq3xyRgETKKsYoEUbiVwm9lywa0yuT9knFbElNQWaBaQkQXjS Q+cXnkrB6hKKQ92dBWnjeZsBQDqX/tdnTRtD6vGv1JfQldCvx/EDmNiQ9L/p+KQ0+9HH zP2Kyrw0r5maJVx98Q79y8VAjZcSi/gIOweeK+GT5jZS8W7HKQH1a6GN1bmnBJPnRb6E ogBqOOqnLaOKRd9YXqe/vnqoLsplQMEzqQ6OgyGyDI/zabRUt5tgzWWsIQi6pWzdfhSO NXjnTgwMtY2pCQ2WuXSMnrlXvMWXXFsL0ClUNL/GlspgJBWH//06+YIBx8qwNGPmqPMf qscA== 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=swM0ckTj5bR2YrkBK2DGG8HipjSCJF4kDVWbAEKQV20=; b=q1/QeelPxmtwkk9/ficLDfY6QhmHDjhV8u1+uoj3WiArNJWq8zjroWENCdpDMuD8Az tjSVVocw3N1NhFkqd2iQKZV5juICQ5VGnnrQWmBZsM+zrB+4Si7SYZln1S8ZpB2y3FtK Vd8YVQ1aJ996fgybW+hC7tXab5NtVmsQmxlYAEPN1UZhO6WCEM3YJ371PCQw5tvLD9M1 c4J8xaToproUEgUYO/7C+T644U2+tF/rPy/agxjKsvrD27YHE17+lE/dFXAx1HwsuxQ0 O4tcL2uhJXi36aAjLM0CLlfYVOOdtLox+CLP2c0drOxRoM9eZxQSUd6VyhWrgw5ZibIJ x6uQ== 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 c191si5344087pfg.72.2018.12.08.00.45.35; Sat, 08 Dec 2018 00:45:50 -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 S1726264AbeLHInf (ORCPT + 99 others); Sat, 8 Dec 2018 03:43:35 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:5430 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726124AbeLHInf (ORCPT ); Sat, 8 Dec 2018 03:43:35 -0500 X-UUID: 0dab31fd19b742cfb6223856853068d2-20181208 X-UUID: 0dab31fd19b742cfb6223856853068d2-20181208 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1939913552; Sat, 08 Dec 2018 16:43:27 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 8 Dec 2018 16:43:26 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 8 Dec 2018 16:43:19 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring CC: Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat , Arvind Yadav Subject: [PATCH v4 14/18] iommu/mediatek: Fix VLD_PA_RANGE register backup when suspend Date: Sat, 8 Dec 2018 16:39:27 +0800 Message-ID: <1544258371-4600-15-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544258371-4600-1-git-send-email-yong.wu@mediatek.com> References: <1544258371-4600-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 1a87a1d..c3b4325 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -721,6 +721,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; } @@ -745,6 +746,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 6385dec..17996e0 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