Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4010877ybi; Mon, 27 May 2019 09:23:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxegpa3jU2v9JcaIYCSP0hbwgZHGeg07AhS/lSSuL1SLzgO1Ch/DEsZPhDhWouf8sTlg8Yc X-Received: by 2002:a17:902:a982:: with SMTP id bh2mr24705498plb.224.1558974210720; Mon, 27 May 2019 09:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558974210; cv=none; d=google.com; s=arc-20160816; b=eWtEoY6ZlfYEjesktPF8H0MKX1avikN0GPBYw992BCK5lK3Qcw6DQydreEFMBT/og4 MLM84eqcJstXW1dF2R0WrzdsgasRdEREjaNXvv/Kvl6HqDbsyOWr66Kzp4Be3QA9Izht QX5Hk4gxHRAJp29CAYwT8R0fTRAjxUwYDIxsqEw1rcSy64w/g0TsZw4giyYgo6snW8UU uSZONjqhzpS7Jlev7fr9MqftbPAIkleCho7kL18Ez+zz3+bbQ3LEsm5OcYgMNl5/eCOP bXgFUvr37kFpHjDcU7KcZezKgfB6bCjz8iEw/RwrZFEMvMZlrJ9zpQkqaI9Hsom62JoH 14Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Z15dgkHRL+Z17D8l0tCQmInGauelQxW+ABdV3lQUbLQ=; b=UxwQd9sdFH0cItYQpQONPigQY0NTFOG4oJoTMAriDl3J1zx16XG264RzABQ0X2Zy+x wcMxHYpt/9MdaYRDgHtXU/78Lao5iRcR33Z67EAXSB8gMZ49DZmGNJXc8H4mS6hxxuGS vtkMYGBx/EylIyccD1/1/UWiy7Wl4axSyefTqRgB+3+kZaT2rAfau2ZIO+KbCVggitsX Baw/++MfsLg8dxQJGW0xcyo82woFerS8F7YVh3ksTgSQ8RkBOKsAIdbcbvNgXpUVKGOk rmS8dRC0sfMWulZBAWTeWO0Bk8BmvjTL1UiQNoBVZ5gfQk9amao8dtGw664dZhgRObUP 058g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si12053166pll.254.2019.05.27.09.23.15; Mon, 27 May 2019 09:23:30 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726547AbfE0QIq (ORCPT + 99 others); Mon, 27 May 2019 12:08:46 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:61506 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725991AbfE0QIq (ORCPT ); Mon, 27 May 2019 12:08:46 -0400 X-UUID: f578e6e65ec34b80906ac5edcba129a2-20190528 X-UUID: f578e6e65ec34b80906ac5edcba129a2-20190528 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1265670405; Tue, 28 May 2019 00:08:38 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 28 May 2019 00:08:36 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 28 May 2019 00:08:36 +0800 From: Miles Chen To: Catalin Marinas , Will Deacon CC: , , , , Miles Chen Subject: [PATCH] arm64: mm: make CONFIG_ZONE_DMA32 configurable Date: Tue, 28 May 2019 00:08:35 +0800 Message-ID: <1558973315-19655-1-git-send-email-miles.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This change makes CONFIG_ZONE_DMA32 defuly y and allows users to overwrite it. For the SoCs that do not need CONFIG_ZONE_DMA32, this is the first step to manage all available memory by a single zone(normal zone) to reduce the overhead of multiple zones. The change also fixes a build error when CONFIG_NUMA=y and CONFIG_ZONE_DMA32=n. arch/arm64/mm/init.c:195:17: error: use of undeclared identifier 'ZONE_DMA32' max_zone_pfns[ZONE_DMA32] = PFN_DOWN(max_zone_dma_phys()); Signed-off-by: Miles Chen --- arch/arm64/Kconfig | 3 ++- arch/arm64/mm/init.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 76f6e4765f49..9d20a736d1d1 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -260,7 +260,8 @@ config GENERIC_CALIBRATE_DELAY def_bool y config ZONE_DMA32 - def_bool y + bool "Support DMA32 zone" + default y config HAVE_GENERIC_GUP def_bool y diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d2adffb81b5d..96829ce21f99 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -191,8 +191,10 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) { unsigned long max_zone_pfns[MAX_NR_ZONES] = {0}; +#ifdef CONFIG_ZONE_DMA32 if (IS_ENABLED(CONFIG_ZONE_DMA32)) max_zone_pfns[ZONE_DMA32] = PFN_DOWN(max_zone_dma_phys()); +#endif max_zone_pfns[ZONE_NORMAL] = max; free_area_init_nodes(max_zone_pfns); -- 2.18.0