Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp131276pxk; Tue, 15 Sep 2020 23:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNFOJ4P0xH/Ys/1WJHOJddChIK8xqN2J/OXOh2SlvuriWh5+eS9Geu25KDlkXXRSfR7z/v X-Received: by 2002:a17:906:dbf5:: with SMTP id yd21mr23321668ejb.521.1600237623239; Tue, 15 Sep 2020 23:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600237623; cv=none; d=google.com; s=arc-20160816; b=j242RagZ9u+gs+xyRQRePgFt5Mwg4HT1bcPefLUc97J10b4DzOiSqQMrOZmeCsHE/9 xu43TvrBi7O0rhoMvhr+7qgRWJecSBZQIJTKJ/2zMJApQd7k+28FNb/AgN0n/fns8JdG MqwY7ZZMy41zz2LrrsUKyxqfmlYoFAduhtviyAgomLvRAVcFKUNB9+vxQZi/40iNBhWL p57XQ5RkmPlSZ38iUm64HnPtYfMQr4oDppravqd+YWG6e8xO02tAyUcIbeD7+B0lRM0e AeVJZBQZrwHZevhP4qnz5jfvilIV6U6EZR/KF4gh64KugOpZBVr4qf0CBLlP5FzaOxg2 bfXw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rZz7WEucbLzmcSBpKZVSsyybm+o08I+OYE053DvRjjM=; b=byyRnutjcB8weguEHVkDUi1O+yigHf3l8BClrr6+gxCpiw3aQuuxCkGvEhYTVRJ9Db Kh3URfHh8AKtq1VgoJwQazC5gCc1jNGbl5KgJ87roYkJHNxgJdB+iLPcaALgEfbMdD/v 70F4b/T6SIby0JhX760YldcMA45HlKwxs/Q+Q78XmtehwYx2BkAYsa902mqKTi228x5w dB9P7roDmi3Xm+oBOOap/a1g8oFwJMdlUia73Gv804JD9908YgmScD1WyPikjJeKkSql Oxxvi1ZqnkHO3c7Xda/k1chCIlwm4P4vSW+fAau/KSbfT9CE1BN+01MBWl6Bd1q1ObLA TlvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=WxTCKh5R; 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 md18si11296339ejb.343.2020.09.15.23.26.40; Tue, 15 Sep 2020 23:27:03 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=WxTCKh5R; 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 S1726380AbgIPG0H (ORCPT + 99 others); Wed, 16 Sep 2020 02:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgIPG0C (ORCPT ); Wed, 16 Sep 2020 02:26:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A36C06174A; Tue, 15 Sep 2020 23:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=rZz7WEucbLzmcSBpKZVSsyybm+o08I+OYE053DvRjjM=; b=WxTCKh5RipO/ghifOttWKDY07y QNmTljydnuaqDLQ3kR/uRVM5HpNnUWS5FbFx0Kp8Kt9rimc4W3gIvIa8DayD7I9+mtCAnKGz6/w3T e4i815xpazXxeeB9uo+qUbZ4axz35wmCVGx1ifmhNI1laNYSGVkapVzYPnsdbtHPRl9bO/Kj4FCKW 1n5cWUKmNXdn9m1c9qSWX8Hix1q1NrzHTfqcV1dEWx+36tFDJC4xG4kuvntDGtb/gw0n+TXkaU94v D5hbJNS63JnwIXTHAGWlf54tzj7lxAqMGvsT3qhQaY8wkKhfgBfcwnMHumJeJ6PsCwvzpl2lqQTI2 lphIJfIw==; Received: from 089144214092.atnat0023.highway.a1.net ([89.144.214.92] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIQt9-0007Y3-K4; Wed, 16 Sep 2020 06:25:55 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org, Russell King , Santosh Shilimkar , Greg Kroah-Hartman Cc: Jim Quinlan , Nathan Chancellor , Florian Fainelli , Robin Murphy , Rob Herring , Frank Rowand , Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 4/6] ARM/keystone: move the DMA offset handling under ifdef CONFIG_ARM_LPAE Date: Wed, 16 Sep 2020 08:14:57 +0200 Message-Id: <20200916061500.1970090-5-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916061500.1970090-1-hch@lst.de> References: <20200916061500.1970090-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy --- 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(); } -- 2.28.0