From patchwork Wed Mar 14 15:09:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 131599 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp988585ljb; Wed, 14 Mar 2018 08:09:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNvNnUvA2q+QZ7aCzEZJJSiiz9Oyi3j8roFaNr87TXzlpPKelb/H7lEX5YJKuYb/Na0hM2 X-Received: by 2002:a17:902:7509:: with SMTP id i9-v6mr4463726pll.220.1521040185792; Wed, 14 Mar 2018 08:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521040185; cv=none; d=google.com; s=arc-20160816; b=Bt9Cgt/3U+CM8LqOoavczzlPC7IZtyaCCFau0mw8V8rtNaoFtxqo2iEbvKrSiIfBW9 ZmFWAlyVECQ3KVYHSUMss7wNsV6enkGkPP9G30h/+1XOiYGazGs6raDWpUyiyiE4Itnw 9/2ZQdlsc7RXZkbr6EaLoWJLttWn/qJcUbaFfCWrVgAOXYUDylSBr/ei537PzxSIBdj9 VRIAx2hzTGV4PEjIBzdUgJGqv4Cc/k77OtKNnN+A1IzVMoHABlNU1veb/56fc5Si5ExI Npj58Kqqis3NJIUzmnzNB6tI5JNhgdwnMqjtRxGeUg8cATbeAyGU/iit0dj8fQcqXA/6 bLQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=//KjnNj1GkC/gBn0mjGFUvOwHuvL7hCfGSt2/XvkpE4=; b=EhtoKTJHOt/aR1L1jig+5UR5VVMxVycO90OHxClwG+0xgcOWeKYay+1ZWPu7ylA4Dy A5gFZ8Dj6D/Ob6Ng4ZwVicQNJxIQ60/Hm9I4osaBf4NXJX/K9tO4mA2pnbMHl0zi9PvZ TRs9hAvmrxk0H5yHyslOzoh7AT/f5eHZJ0aG2WelGI4l2pOojc9dVF4us/dO0xzoRecO WIpRaV5qggZ9dPRvlLVqpKYpSp53AceZWrCbvRLnw4zkkOkpfgyzx1/Fj/fh6XNGwmJc S18A8R8mOJKjEHk1dJDK78QnhRkOF5SqG+YRICgRc5n1CiX0XdJT/Og1Ioy8SpbRDXt5 tMzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ft8Om5JG; 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 b59-v6si2115924plb.529.2018.03.14.08.09.42; Wed, 14 Mar 2018 08:09:45 -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; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ft8Om5JG; 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 S1752137AbeCNPJh (ORCPT + 28 others); Wed, 14 Mar 2018 11:09:37 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33064 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbeCNPJg (ORCPT ); Wed, 14 Mar 2018 11:09:36 -0400 Received: by mail-wm0-f67.google.com with SMTP id s206so18943057wme.0 for ; Wed, 14 Mar 2018 08:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=//KjnNj1GkC/gBn0mjGFUvOwHuvL7hCfGSt2/XvkpE4=; b=ft8Om5JG4EeD6Sk+B6nvffauBZOZ0iR7JInS/ICP3P0s32agfoKt1dmPqvsAAX7YXp 1a1sQ+QT7FQqCg3vauYfDqhgPd+3wzZvU90VN/kDp0uR9N+mHUeK0Bddqeo6Cesx8cAw BIqtWNzms6N7+nf9wxmPRjmTPDVVuL6aq6Tsenj7Y5/zDUY13nQPNhTgHjxO9C1GGcw3 CEwxfjh50t6eww1QlCMmjldo229rqwIKWZK+8WYAfKROLksj9e9xkQIU+QBw4XxIT/ri Ns0XBWMXzWJVJiD/9jNPQrA8RlTRnLxwvrydO0pXH9Y/UBsixRUnwiTmyxCObySlqjaN vn+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=//KjnNj1GkC/gBn0mjGFUvOwHuvL7hCfGSt2/XvkpE4=; b=KafdCXqCnqAn4i93Sl15jQm47XoV1SRIlEWFjgosMdO43BOm4P3RmaIh/mHJCh5+Dp D4seY2XTRoCKqWDJG6aSUYnlCWmfiermc4NrGiiISqAYKpIV0/aI9uC6i+YbNCwRmTOO yUuSKLyS6sguIX93VcVGYL30bZWa7NXKUPEXd7WcL1NvXlNd+sQECB68hQjJghBADtr1 wSWT58tts/vJXoLc/Hc4tebcsXr7NDSMoKa0TWPgEaA/700VK3zQvkWacApfSoiHQH1v 1sW2h0j9vXAPwUSoM6NLQd0iacloYyj4TY7q4kgdOhiL1uS2uspShGHAG3Myt6XZN7kh d46g== X-Gm-Message-State: AElRT7FakngZZFMXPeiDyn92BiPVxIQT/mYrYh14b7u8q0b+QLuAiSIP ut2JrjWA73f4i2tabrg8LFSmPje/ X-Received: by 10.28.7.13 with SMTP id 13mr1919419wmh.9.1521040174632; Wed, 14 Mar 2018 08:09:34 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id q21sm2018212wmd.12.2018.03.14.08.09.33 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 14 Mar 2018 08:09:33 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Cc: Rob Herring Subject: [PATCH v2 1/2] microblaze: remove unused alloc_maybe_bootmem Date: Wed, 14 Mar 2018 16:09:31 +0100 Message-Id: <77785f26fa882362b5e72e71845bb607f2cec757.1521040166.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring alloc_maybe_bootmem is unused, so remove it. Signed-off-by: Rob Herring Signed-off-by: Michal Simek --- Changes in v2: None arch/microblaze/include/asm/setup.h | 1 - arch/microblaze/mm/init.c | 8 -------- 2 files changed, 9 deletions(-) -- 1.9.1 diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index be84a4d3917f..7c968c1d1729 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h @@ -44,7 +44,6 @@ void machine_early_init(const char *cmdline, unsigned int ram, void machine_halt(void); void machine_power_off(void); -extern void *alloc_maybe_bootmem(size_t size, gfp_t mask); extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); # endif /* __ASSEMBLY__ */ diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index 434639f9a3a6..5bc9c7fbb541 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -414,14 +414,6 @@ void __init *early_get_page(void) #endif /* CONFIG_MMU */ -void * __ref alloc_maybe_bootmem(size_t size, gfp_t mask) -{ - if (mem_init_done) - return kmalloc(size, mask); - else - return alloc_bootmem(size); -} - void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) { void *p; From patchwork Wed Mar 14 15:09:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 131600 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp988637ljb; Wed, 14 Mar 2018 08:09:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELvks3j276MsvtvuPJ0RWAylFmNDLvln7HXAheroSvIkCxJmtU+Tfnh29Ugob4MoWnH9Y4DZ X-Received: by 2002:a17:902:128c:: with SMTP id g12-v6mr4340739pla.98.1521040188020; Wed, 14 Mar 2018 08:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521040188; cv=none; d=google.com; s=arc-20160816; b=rs8k3EtxiMSiPawXjTes/EUK9lDYBHcQrdTRC8p9zYpupbJfXLJWk2IKrxA9G0ikHk 1/zrW80LIR4dEV+nHhPcvSDrMyBe74mdueDvelqlfDNDbXNILEz2hORgl1jIKz8wOh/9 0LaD5v48shbxV3K5+VOLWgqhrlmlb1QCkvMplVgP1EMzcfUHsd0pSgEAbKSI4kzcf4Qq 7X7lh3GyVNB14DJiRZIhxGFmdfCtAoZSLuat8COG852U7pd9ofbPyJ5afQ0c7KDmKYGe B1XcIEpQF35rAmhj7YqxYromyWSNqw0t1Is5rdyUbjrErENNOqQzaFq2Wn9cO0zR3XY7 BWvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=qerQ2bku6ysn8oIyFNGBr6XiAFe3IXGpfVYFuZTScsY=; b=krYZIK0L+TrCmKdY5zEd6MY+8LlId7VhB0au+rfAI0BoAmd5FInsKKgimgc32Rj/vN wF1f2wRH/NnBe+FRTJxmd/ddqrQOSpwMtUWBEblINjp5o3hURi7Tb8bc+P5A7alZ7ZC3 i/ON+PhhST1ftcSxMJuEYWjZsCvLBc+2+9+N5STwtPzSmBJkml1IN7Z9kFA4BZdNSmAt eREMh8kRVV4ovqKqODgQIlWgij72BZKAYlmggPe1DwHyZKCcAqL+r9qS60dQFEIOeGBG neRzO9QcaacQRY0ZGSaQnnTo1jyu188wP9rJ8Bz0FBUFfE3vmKmZz4YIL1h+6nD2T1nN 9XMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ymzXct+c; 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 y11-v6si2103074plg.154.2018.03.14.08.09.46; Wed, 14 Mar 2018 08:09:48 -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; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=ymzXct+c; 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 S1752177AbeCNPJn (ORCPT + 28 others); Wed, 14 Mar 2018 11:09:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36241 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbeCNPJh (ORCPT ); Wed, 14 Mar 2018 11:09:37 -0400 Received: by mail-wm0-f65.google.com with SMTP id i194so4695302wmg.1 for ; Wed, 14 Mar 2018 08:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=qerQ2bku6ysn8oIyFNGBr6XiAFe3IXGpfVYFuZTScsY=; b=ymzXct+cVlUmga+P4YJ5J0XXohbF0e744qIidmiDLDuoPa98/mA03+8e3K8M8pWGJ2 6VB62aMzd+vNkSrbe227ng1L/0iFLYETSMiZJmr9ZDkdhSXXn1iG19jgxLihBBrpxSRa XQUk9Uyai+5W3yrdPwsXBun77lVt8Y0SkaDabJTlajfVm9LbNm4D6e55NOfTKHUzM5yW TdxonOJCOB5qJfESc+whka0zQdC0ujh2j2fMjcp/jDh7q9KGbDi2DdC3pnRvG+hup/di uS9FBKHsRSzz24aJXh9hUxGZZnBy8sFMuOXBVDYAgTRgDs8TEKwlPw8Zwrq6j1d+DdS9 wrWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=qerQ2bku6ysn8oIyFNGBr6XiAFe3IXGpfVYFuZTScsY=; b=NL3VIPwUYt+AoXGfGcqbjqmqYI983BKnHFMkXFsS3l/k2w3OoD+5CDTJU5bFfX/GXV uoXTNdj8HG5cCGYPm8aTJT4uFjNP/+bSI71IAZ41PVAnZ7yCcRqfPKAo6HPv8kzH+2x2 xmlNNOj+0VyS3aqS9cSfEnPD7NB/oXtNVxbLBz9Uz8sKgQ2gOnNe9tQHjIVC5SyYIHHT 7B3guYxpmwmreBDjp8gCBEePxm0xc7mVQlcoEuotkfzyH4pTfXlw9ZW+eiloBYLJMaCg u4EqsvQNepPPWjcksgOy0EkCtXaC3uRW2VsLc8/lMP2+r/4CzhEIeEZzudavpbnWJk0r TaNQ== X-Gm-Message-State: AElRT7GjHQRfYZ0lUxjfQHbL8h53GMkNriXRgkdg+taXSLXnr+E+XHLG n+ZgSjmpc4PyACjQRJQ/mR81kqgi X-Received: by 10.28.32.70 with SMTP id g67mr2100941wmg.146.1521040176265; Wed, 14 Mar 2018 08:09:36 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id j89sm2427995wrj.92.2018.03.14.08.09.35 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 14 Mar 2018 08:09:35 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Cc: Rob Herring Subject: [PATCH v2 2/2] microblaze: switch to NO_BOOTMEM Date: Wed, 14 Mar 2018 16:09:32 +0100 Message-Id: <2c20c2cbe89af51b7e59abbcda71e87fd1959bc5.1521040166.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <77785f26fa882362b5e72e71845bb607f2cec757.1521040166.git.michal.simek@xilinx.com> References: <77785f26fa882362b5e72e71845bb607f2cec757.1521040166.git.michal.simek@xilinx.com> In-Reply-To: <77785f26fa882362b5e72e71845bb607f2cec757.1521040166.git.michal.simek@xilinx.com> References: <77785f26fa882362b5e72e71845bb607f2cec757.1521040166.git.michal.simek@xilinx.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring Microblaze doesn't set CONFIG_NO_BOOTMEM and so memblock_virt_alloc() doesn't work for CONFIG_HAVE_MEMBLOCK && !CONFIG_NO_BOOTMEM. Similar change was already done by others architectures "ARM: mm: Remove bootmem code and switch to NO_BOOTMEM" (sha1: 84f452b1e8fc73ac0e31254c66e3e2260ce5263d) or "openrisc: Consolidate setup to use memblock instead of bootmem" (sha1: 266c7fad157265bb54d17db1c9545f2aaa488643) or "parisc: Drop bootmem and switch to memblock" (sha1: 4fe9e1d957e45ad8eba9885ee860a0e93d13a7c7) or "powerpc: Remove bootmem allocator" (sha1: 10239733ee8617bac3f1c1769af43a88ed979324) or "s390/mm: Convert bootmem to memblock" (sha1: 50be634507284eea38df78154d22615d21200b42) or "sparc64: Convert over to NO_BOOTMEM." (sha1: 625d693e9784f988371e69c2b41a2172c0be6c11) or "xtensa: drop sysmem and switch to memblock" (sha1: 0e46c1115f5816949220d62dd3ff04aa68e7ac6b) Issue was introduced by: "of/fdt: use memblock_virt_alloc for early alloc" (sha1: 0fa1c579349fdd90173381712ad78aa99c09d38b) Signed-off-by: Rob Herring Tested-by: Alvaro Gamez Machado Tested-by: Michal Simek Signed-off-by: Michal Simek --- Changes in v2: - Forget to remove map_size which is unused now. arch/microblaze/Kconfig | 1 + arch/microblaze/mm/init.c | 56 +++++------------------------------------------ 2 files changed, 7 insertions(+), 50 deletions(-) -- 1.9.1 diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 4f798aa671dd..3817a3e2146c 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -24,6 +24,7 @@ config MICROBLAZE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_TRACER + select NO_BOOTMEM select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP select HAVE_OPROFILE diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index 5bc9c7fbb541..df6de7ccdc2e 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -32,9 +32,6 @@ #ifndef CONFIG_MMU unsigned int __page_offset; EXPORT_SYMBOL(__page_offset); - -#else -static int init_bootmem_done; #endif /* CONFIG_MMU */ char *klimit = _end; @@ -117,7 +114,6 @@ static void __init paging_init(void) void __init setup_memory(void) { - unsigned long map_size; struct memblock_region *reg; #ifndef CONFIG_MMU @@ -174,17 +170,6 @@ void __init setup_memory(void) pr_info("%s: max_low_pfn: %#lx\n", __func__, max_low_pfn); pr_info("%s: max_pfn: %#lx\n", __func__, max_pfn); - /* - * Find an area to use for the bootmem bitmap. - * We look for the first area which is at least - * 128kB in length (128kB is enough for a bitmap - * for 4GB of memory, using 4kB pages), plus 1 page - * (in case the address isn't page-aligned). - */ - map_size = init_bootmem_node(NODE_DATA(0), - PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn); - memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size); - /* Add active regions with valid PFNs */ for_each_memblock(memory, reg) { unsigned long start_pfn, end_pfn; @@ -196,32 +181,9 @@ void __init setup_memory(void) &memblock.memory, 0); } - /* free bootmem is whole main memory */ - free_bootmem_with_active_regions(0, max_low_pfn); - - /* reserve allocate blocks */ - for_each_memblock(reserved, reg) { - unsigned long top = reg->base + reg->size - 1; - - pr_debug("reserved - 0x%08x-0x%08x, %lx, %lx\n", - (u32) reg->base, (u32) reg->size, top, - memory_start + lowmem_size - 1); - - if (top <= (memory_start + lowmem_size - 1)) { - reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT); - } else if (reg->base < (memory_start + lowmem_size - 1)) { - unsigned long trunc_size = memory_start + lowmem_size - - reg->base; - reserve_bootmem(reg->base, trunc_size, BOOTMEM_DEFAULT); - } - } - /* XXX need to clip this if using highmem? */ sparse_memory_present_with_active_regions(0); -#ifdef CONFIG_MMU - init_bootmem_done = 1; -#endif paging_init(); } @@ -398,18 +360,12 @@ asmlinkage void __init mmu_init(void) /* This is only called until mem_init is done. */ void __init *early_get_page(void) { - void *p; - if (init_bootmem_done) { - p = alloc_bootmem_pages(PAGE_SIZE); - } else { - /* - * Mem start + kernel_tlb -> here is limit - * because of mem mapping from head.S - */ - p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE, - memory_start + kernel_tlb)); - } - return p; + /* + * Mem start + kernel_tlb -> here is limit + * because of mem mapping from head.S + */ + return __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE, + memory_start + kernel_tlb)); } #endif /* CONFIG_MMU */