Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4851753pxu; Wed, 21 Oct 2020 07:00:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqET1gXv2OkWmy6QI8ehniUZ+7mlfIsCqqxIyE/2PG8wc++fx+lRMnGUYaLn7efQDZ0l9j X-Received: by 2002:a17:906:9394:: with SMTP id l20mr3623000ejx.40.1603288806332; Wed, 21 Oct 2020 07:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603288806; cv=none; d=google.com; s=arc-20160816; b=NU35yHtFCfAz70FxIYal7mY2pb8CQOtnnm/0WS3PxGHW3WNzXFVZbZTQ3p50coZg4m 5M+7nxi3GU2sC+c3I10wYNPdf2c4Fqn1xA5JtPId+vx5wjpTkeKJ65rVaWafLdA89zuI XzrWzp/D0O0L1J+p7LMoWSZYOXiNuIL30B2WpCb9Z/moIVOBSKX8grnQkhFBzwWdIL+6 8p6aEEW7uOhIlf8UNyp8VlbqyuQ62R6XE4uIFyTb0mr5ATDh7wk5H+P3vuMd8yEpUXS0 JJ2C9cLk8FQXhcscMHA/jPKvvaD+Px4TWvJ0v/geIbmws4Ex3hf4KFg54qld4s+KUNAB N0OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=R1VIpFqbq4P1sb/pqlj9A1PeOd9QbKy9ckwpCqYNbJU=; b=WGZyqgEl12BcC2TsQbVRK+bhSrusNqKAcAXuY7baJ9rAOvvTDa4Km7fd4XmZxt6/et 8yJmv1CwzYSkj/95mf9BCR0x/Q+3jwL73hBlkyM4Xd3ESgyd1ZhYM78Q0faiOq6XOyMj QaUR+lm0/CS9VYWcKDKdQ4cSgA2O/90D+llU46mgB+/OS7vk4BwLJQdgWwUfjvW4P2iL hzi4MavV0TqGfV+WxbQi30EWvMCo6tibVTXpIbvzsxPaOlVYNkGUA4IN+gGk979xU4yX efUovDJGjCSw6stalb2zEccYKdzX2P1DQKx2ZPuhuX4npHz3+kdAaQ5ZUjJAWF7GK5s5 PzJA== 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 3si1360796ejz.513.2020.10.21.06.59.44; Wed, 21 Oct 2020 07:00:06 -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 S2442400AbgJUMfd (ORCPT + 99 others); Wed, 21 Oct 2020 08:35:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:50790 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442384AbgJUMfa (ORCPT ); Wed, 21 Oct 2020 08:35:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5B2CCAC2F; Wed, 21 Oct 2020 12:35:28 +0000 (UTC) From: Nicolas Saenz Julienne To: robh+dt@kernel.org, catalin.marinas@arm.com, hch@lst.de, ardb@kernel.org, linux-kernel@vger.kernel.org Cc: robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, jeremy.linton@arm.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, will@kernel.org, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, Nicolas Saenz Julienne Subject: [PATCH v4 2/7] arm64: mm: Move zone_dma_bits initialization into zone_sizes_init() Date: Wed, 21 Oct 2020 14:34:32 +0200 Message-Id: <20201021123437.21538-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201021123437.21538-1-nsaenzjulienne@suse.de> References: <20201021123437.21538-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org zone_dma_bits's initialization happens earlier that it's actually needed, in arm64_memblock_init(). So move it into the more suitable zone_sizes_init(). Signed-off-by: Nicolas Saenz Julienne --- arch/arm64/mm/init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index fc4ab0d6d5d2..410721fc4fc0 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -190,6 +190,8 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) unsigned long max_zone_pfns[MAX_NR_ZONES] = {0}; #ifdef CONFIG_ZONE_DMA + zone_dma_bits = ARM64_ZONE_DMA_BITS; + arm64_dma_phys_limit = max_zone_phys(zone_dma_bits); max_zone_pfns[ZONE_DMA] = PFN_DOWN(arm64_dma_phys_limit); #endif #ifdef CONFIG_ZONE_DMA32 @@ -376,11 +378,6 @@ void __init arm64_memblock_init(void) early_init_fdt_scan_reserved_mem(); - if (IS_ENABLED(CONFIG_ZONE_DMA)) { - zone_dma_bits = ARM64_ZONE_DMA_BITS; - arm64_dma_phys_limit = max_zone_phys(ARM64_ZONE_DMA_BITS); - } - if (IS_ENABLED(CONFIG_ZONE_DMA32)) arm64_dma32_phys_limit = max_zone_phys(32); else -- 2.28.0