Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp12441876imu; Wed, 2 Jan 2019 00:05:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XUCgpstlsZitV8Ej5ib78cxdAd6Y3+yyku1DF8HOJy+p4Zu2JjapUUDsN5KwvYIISn+oNj X-Received: by 2002:a62:d701:: with SMTP id b1mr42728329pfh.34.1546416327642; Wed, 02 Jan 2019 00:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546416327; cv=none; d=google.com; s=arc-20160816; b=GLVKxmh5weWi7qIcEaoOGaV0oTF4oGhq4jZLFyOY6F6uZV3QhYw9tXKhBh1l5LnjFk LaG96jWfmrJg38H6HYYXIlPP3w1mW32kUiUD6WfnFtvem/6dGe4HZp3FKN8k1eAK4O17 H1ivjkFQbm0jQ0WIgzELeQKHi8HHYA5gkEzkJaP//RM7hiu1UeT/7dtk3foo2PBXjbOH sEw4GFfoIW2gU7pw+emXfDxKfRHnVDXD7XhIuOmgtZaBvsnxZoRYzdfHWeKzfBMTygJC rrtrzBGsZzygM8gLdF9O6ryVI0+RdM2EZ0dJ3bIDmjN1ve6GLwPq4InGcVY8HW4+/xaS ARzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ip8/SWgSo5UCVMc09lG/mRV3/rvBHR6BxLBivxzsv4g=; b=Dy3EONVKWwYMJnCglH2PYvREffVDxq8ZZudql8Q1aSOCR0LswJuM9GJuu/IR+H6lii tMeJcJZJVbN0GecHIwnMcVzH92Hy59xauX/V9VBuhpv9zJ3Okl+1Xk1iQrq7KBsAsnoV gfOooad/C3BLF4EWRXdSDaBe5yvv1WYJM0rilKlQ3+6tQl1ZYIvAa4njNIji8mBakonb EWqjn1WShVtIpayKQxGCmn8H5Lmf6i1cMv0hfLUQ9WJHrmCSmJpSrUg1Yw70OIzxPbQB x88nEkRnyNY9UIcQDWRZ6Y5vVOEEzr4NYrCNr6X1Idbl8prXoHWesQOiXxhhv7KIxvZx xwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gzL4g9nD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si4192665pge.384.2019.01.02.00.04.50; Wed, 02 Jan 2019 00:05:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=gzL4g9nD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbfABGyW (ORCPT + 99 others); Wed, 2 Jan 2019 01:54:22 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39008 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbfABGyW (ORCPT ); Wed, 2 Jan 2019 01:54:22 -0500 Received: by mail-qt1-f193.google.com with SMTP id u47so27968919qtj.6 for ; Tue, 01 Jan 2019 22:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ip8/SWgSo5UCVMc09lG/mRV3/rvBHR6BxLBivxzsv4g=; b=gzL4g9nDiolo7xKtSXGwOBsS3KFom7nTZaj3UQf3Pwct3mH3w4gw0Am7qKs7/qLOB/ qwcyFonUxVDqlkYIoKwzPtAbEcFLdlcxcvFGWbh8+dMLIw1WT9nlY+JmlyvQb6ObyAUK wfquMC/ndnLxZMHBtKybHr2Y+MkPFJxxvxyUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ip8/SWgSo5UCVMc09lG/mRV3/rvBHR6BxLBivxzsv4g=; b=T0UxPYAokS6G2IkkrK+/keDAPlBQDDtFiuwUvaSYtM/IFc9V9jKlFnqD4yXA5TXoj8 L4DP0vRa+E3v6zXicokfbYuqNISFUGrShyEVt+tMkNcV3U7nnLbbvyGKVySuabeXledx d1eV3io3j+7kHgK5TJaxTsVb7CM8/RCahtEw5EWy7/h24bONE7AX9PdP0pJhhPG5A5Ge kV6PU6Y2myCsKoRwR0fR5tvXNXFPC6CTve9HAll8ZqcGo0YwYaCrpr3TlfmnpqYIQyHV NeQCaQL5vboeLhyCoBWvdANvkWjeOmvcjeoWjLSTXN2foIJ/elVO4tzZ5msFjTv1/UI7 +Kcg== X-Gm-Message-State: AJcUukfwWnxEchouaBYIar2I+xg4E/1iGf+Mvj9bRs4For/hJtuO1w+Z 18mdHUZpoaD3j/RAS2aQaXU9uZgzMKwUW6dtWHv1Zw== X-Received: by 2002:a0c:8425:: with SMTP id l34mr42318055qva.101.1546412059811; Tue, 01 Jan 2019 22:54:19 -0800 (PST) MIME-Version: 1.0 References: <1546314952-15990-1-git-send-email-yong.wu@mediatek.com> <1546314952-15990-19-git-send-email-yong.wu@mediatek.com> In-Reply-To: <1546314952-15990-19-git-send-email-yong.wu@mediatek.com> From: Nicolas Boichat Date: Wed, 2 Jan 2019 14:54:09 +0800 Message-ID: Subject: Re: [PATCH v5 18/20] iommu/mediatek: Fix VLD_PA_RANGE register backup when suspend To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Robin Murphy , Rob Herring , Tomasz Figa , Will Deacon , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, lkml , linux-arm Mailing List , iommu@lists.linux-foundation.org, Arnd Bergmann , Yingjoe Chen , youlin.pei@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 1, 2019 at 11:59 AM Yong Wu wrote: > > 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); Don't we want to add: if (data->plat_data->vld_pa_rng) before this save/restore operation? Or it doesn't matter? > 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; Well, please be consistent ,-) Either vld_pa_rng, or valid_pa_range ,-) > }; > > enum mtk_iommu_plat { > -- > 1.9.1 >