Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp188650pxk; Fri, 11 Sep 2020 04:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2lR1+ST4v5cSA6xxUYa51VbT+ZYjtesi42J5EMLMVfmIcFmP1zfPoU5CIFL4team2l4tm X-Received: by 2002:a17:906:7cc6:: with SMTP id h6mr1529260ejp.266.1599822874553; Fri, 11 Sep 2020 04:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599822874; cv=none; d=google.com; s=arc-20160816; b=f3nlcssyMS/47gqD5hMIMhVj9ErjdVsqlZSVY5xwCPK7OCdgw2c8Pfcw101hXQcgbR uhR8y7zixe/oJN1DdJ9RoV0cZn3aFV+FUOqZprVNB3LgpbKzeGf2jcC7Up2x7MQiAPdD 8NWperH96kL9RvSTbL3C7H2fLEMHmC7qV6RQ6ph5GdAdhuwPJTgfXm8/2qSQFynszmUE Kn6/pEnwqMrDFzA9hxc/Z6KCiEmxyP53MF+V4fLL2tYKYslT07OKhfn49kdMXC/OY/xf ZHqZBgndSu9JiXdQQEHHZJeWqhGk49fbGgbTMLLfP55BFYl/XvETJzWQzZtJzpRAjHcW G/Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=CCOZG0pxgAXrElKbCrAte7pvEkFeXajg/JDWm42nXro=; b=0/G4gWaxasdy+fD5g2Ga1xHPzv8hw7MsTg5yDpRNZfYOoJERTo7MzQ6JS2JeWtWW5X LdLpTQPrObQ+9nAqr/Hywhc/NKXGS8ONP7TSl8cfq74jVwT2kTB1fFnfmqoJ2qY7Mn9L XYigVVndIJN9V1DQua/vqh8UQ381WHwkMMAEiXpf51lboOmcrjLvgrHQ+RFegVgkhklg oaRqg/O1VDUIRyk0uhCGtlgyJyPpYQLw6VKXVFBpQlalwCXVkz1vH1nR7Mgxx+okL/Ql 2EjEKXVWTYuhorwCdUcmCqnrSNFEbhdvSP3xFnGu2kt3eXZVUZk3EktZy/+qtUoAdxW1 RV5w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si1054179ejj.264.2020.09.11.04.14.11; Fri, 11 Sep 2020 04:14:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725805AbgIKLMh (ORCPT + 99 others); Fri, 11 Sep 2020 07:12:37 -0400 Received: from foss.arm.com ([217.140.110.172]:60084 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgIKLMM (ORCPT ); Fri, 11 Sep 2020 07:12:12 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 88107113E; Fri, 11 Sep 2020 04:12:11 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8C36F3F68F; Fri, 11 Sep 2020 04:12:05 -0700 (PDT) Subject: Re: [PATCH 2/3] ARM/keystone: move the DMA offset handling under ifdef CONFIG_ARM_LPAE To: Christoph Hellwig , iommu@lists.linux-foundation.org, Russell King , Santosh Shilimkar Cc: devicetree@vger.kernel.org, Florian Fainelli , linux-sh@vger.kernel.org, Frank Rowand , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Rob Herring , Jim Quinlan , linux-pci@vger.kernel.org, Nathan Chancellor , linux-arm-kernel@lists.infradead.org References: <20200910054038.324517-1-hch@lst.de> <20200910054038.324517-3-hch@lst.de> From: Robin Murphy Message-ID: Date: Fri, 11 Sep 2020 12:12:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200910054038.324517-3-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-10 06:40, Christoph Hellwig wrote: > The DMA offset notifier can only be used if PHYS_OFFSET is at least > KEYSTONE_HIGH_PHYS_START, which can't be represented by a 32-bit > phys_addr_t. Currently the code compiles fine despite that, a pending > change to the DMA offset handling would create a compiler warning for > this case. Add an ifdef to not compile the code except for LPAE > configs. Seems reasonable - once again I wonder whether this notifier is really needed any more since "dma-ranges" should now be handled properly for PCI devices as well, but that's not something to worry about in this series. Reviewed-by: Robin Murphy > Signed-off-by: Christoph Hellwig > --- > arch/arm/mach-keystone/keystone.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c > index 638808c4e12247..dcd031ba84c2e0 100644 > --- a/arch/arm/mach-keystone/keystone.c > +++ b/arch/arm/mach-keystone/keystone.c > @@ -24,6 +24,7 @@ > > #include "keystone.h" > > +#ifdef CONFIG_ARM_LPAE > static unsigned long keystone_dma_pfn_offset __read_mostly; > > static int keystone_platform_notifier(struct notifier_block *nb, > @@ -48,14 +49,17 @@ static int keystone_platform_notifier(struct notifier_block *nb, > static struct notifier_block platform_nb = { > .notifier_call = keystone_platform_notifier, > }; > +#endif /* CONFIG_ARM_LPAE */ > > static void __init keystone_init(void) > { > +#ifdef CONFIG_ARM_LPAE > if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START) { > keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START - > KEYSTONE_LOW_PHYS_START); > bus_register_notifier(&platform_bus_type, &platform_nb); > } > +#endif > keystone_pm_runtime_init(); > } > >