Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1237496pxk; Fri, 4 Sep 2020 04:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPwlZBKT5kDVf/pl2DdfSpapayBeKQbJMPuSPQE41mTdYgVKBkuyk2s52oGDTzlQ5ZOp+s X-Received: by 2002:a17:907:104c:: with SMTP id oy12mr7077603ejb.450.1599219289902; Fri, 04 Sep 2020 04:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599219289; cv=none; d=google.com; s=arc-20160816; b=sJ+da+MlAPkBGwZB4QP88mI8s5H6WADaZgMBnpXmPFjdH/PTxfnz8rXTvVmPr73EYg Hgi7Tqj2s5ATue/cJl/xzpix4H/YOAcEHorNOz9ema/tWgyTOfvORHZarQgfETdto1qr XEw+LpjaCkyL9u0ssYfUK/Ax2AXwaCcSn9USAQfhRunGVPu2KNHYaHH5FJwu0Vvu7UtF y34YKoRD6aF0oIS/4yV+4Ew6Oy/FnnobKQS9tvct+u+iDee18ydLVvLbbgHOamwprzNf fpNc5Arur/4CESaHscUyGHGg9Rygk17Y+QR+UpkEbIrzNSO8SKeYRpV4AfmJTUNumHbx PBrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0W9a8RMdxEUMHhSMRHcgR48OmSMcwLPqI21kEQzDmPg=; b=Is77anJQo90K6LrMP0J2US0bpsuw0YKN+KF6Li2WzqX794jOKgN4ogwoWLr1ss/gsD P0mdPRfc4JZHIZSS/GIgwUurHhHGfoGFh01hy5lacQeOQzhCFLfZlLsZ4wMk5nZlBtUO t5keK8Zk14zF5Af6rd0JgSd7BGHxC8ci+u83Q3MUED+GBZtZXeUIejd8UpVSibmCSy1d d0isGXST5Q49UcAMrVolv0jBinDIYPWTHcxfW0tUR/6x/2dGjbZFh03oLtQuUMzDhyRY BgPKMMfLtkvTW2mNooKQvqFdsONJutc7Z/gc3107GudqY6uFudYDFn//Z25cprVewavQ S9KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw1si3745164ejb.144.2020.09.04.04.34.27; Fri, 04 Sep 2020 04:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730151AbgIDLdB (ORCPT + 99 others); Fri, 4 Sep 2020 07:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730010AbgIDLb6 (ORCPT ); Fri, 4 Sep 2020 07:31:58 -0400 X-Greylist: delayed 6918 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 04 Sep 2020 04:21:25 PDT Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A532CC061262; Fri, 4 Sep 2020 04:21:24 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 6B8533D5; Fri, 4 Sep 2020 13:21:19 +0200 (CEST) Date: Fri, 4 Sep 2020 13:21:18 +0200 From: Joerg Roedel To: Miles Chen Cc: Rob Herring , Matthias Brugger , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, Yong Wu , Chao Hao , Yingjoe Chen , Mike Rapoport , David Hildenbrand , Christoph Hellwig , Rob Herring Subject: Re: [RESEND PATCHv5] iommu/mediatek: check 4GB mode by reading infracfg Message-ID: <20200904112117.GC16609@8bytes.org> References: <20200904104038.4979-1-miles.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904104038.4979-1-miles.chen@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 06:40:38PM +0800, Miles Chen wrote: > In previous discussion [1] and [2], we found that it is risky to > use max_pfn or totalram_pages to tell if 4GB mode is enabled. > > Check 4GB mode by reading infracfg register, remove the usage > of the un-exported symbol max_pfn. > > This is a step towards building mtk_iommu as a kernel module. > > [1] https://lore.kernel.org/lkml/20200603161132.2441-1-miles.chen@mediatek.com/ > [2] https://lore.kernel.org/lkml/20200604080120.2628-1-miles.chen@mediatek.com/ > [3] https://lore.kernel.org/lkml/20200715205120.GA778876@bogus/ Applied, thanks.