Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp804306imm; Wed, 4 Jul 2018 06:19:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeK71O28tzhof+i8BErGBtM/erCqgryMHV+7couXqh9EflIUNYo8U5GGnsNvgo+UIINHgH4 X-Received: by 2002:a65:6094:: with SMTP id t20-v6mr1956153pgu.264.1530710380494; Wed, 04 Jul 2018 06:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530710380; cv=none; d=google.com; s=arc-20160816; b=k4Xsjy9NOrXML2TS5DzcPmPCIphzkes86BpjAXdDxMEmL/UB4gV1LNCBH21FE5jpNz nPaD/itO/Q1qUY9h0UhVZcSjkovElAlwEJqRnjgVudRTjfTCnvK3Ae2u58GBfX7NIeLS gB0FSAWG1YnQ9aEt2yqa5C48x0Uf9qa1TvI0ngtyyEQ0iR88yS+307hH0SOMHeI2tNQG 93JXsLHj/39SY0ffAKUKPnRbc3zRN5ISYv9jV7wSpPxuH6YJ9TpcFdMbtsTcC1EWYj6d U6F8yc8CjyqU/vRijVCfoQznUHqF8uecOgW9HO3SfEqVfqYhkAMbdA64s45H9cFj+2Zd Vdiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=I7lOvAGSHR+WUBeoUpdLvz7W+y8IkNxJeDB6XfW3R24=; b=cWsd0K7mURX6Jz/dwUh+Wi393ObkR6omZ+Tqk2+DWuG+4FiiD0hU7em1YOKAqRElwd 3c8JXuylNF2YUl9fjZ5f24342VdJuoM4Z+vegEemTsMZUDhMieiRTZyle1PzTbcVMI+5 tzmlrxVt3MACgrf7t1pu2biQphKIxgNQsrBJX2uOreijF2Ng5fmMTqBS64cxOp/9cBMk RahRmjD7eJVSST0f3EZ76Cd0F8yUoVOBgqLzExFCQr8EgXkPo6JxdRydn0pi7hW4Ctln UtWmq+ekcsh1DRuoVojZfWBpuF/Ki82uiLxR/imGn1kq0uOEePj33AudueKb3y6aAtbS KOVA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 87-v6si3592467pfi.60.2018.07.04.06.19.26; Wed, 04 Jul 2018 06:19:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753579AbeGDNSh (ORCPT + 99 others); Wed, 4 Jul 2018 09:18:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42110 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488AbeGDNSc (ORCPT ); Wed, 4 Jul 2018 09:18:32 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w64D98gt121425 for ; Wed, 4 Jul 2018 09:18:32 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k0xkvs757-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Jul 2018 09:18:32 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Jul 2018 14:18:29 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 4 Jul 2018 14:18:26 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w64DIPgD42401936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Jul 2018 13:18:25 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D3EBA4051; Wed, 4 Jul 2018 16:18:50 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE12EA404D; Wed, 4 Jul 2018 16:18:48 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.160]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 4 Jul 2018 16:18:48 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Wed, 04 Jul 2018 16:18:23 +0300 From: Mike Rapoport To: Ley Foon Tan Cc: Rob Herring , Frank Rowand , Michal Hocko , nios2-dev@lists.rocketboards.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport Subject: [PATCH 3/3] nios2: switch to NO_BOOTMEM Date: Wed, 4 Jul 2018 16:18:15 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530710295-10774-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1530710295-10774-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18070413-0012-0000-0000-00000286B2CB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070413-0013-0000-0000-000020B83605 Message-Id: <1530710295-10774-4-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-04_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=951 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040152 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove bootmem bitmap initialization and replace reserve_bootmem() with memblock_reserve(). Signed-off-by: Mike Rapoport --- arch/nios2/Kconfig | 2 ++ arch/nios2/kernel/prom.c | 7 ------- arch/nios2/kernel/setup.c | 37 +++++-------------------------------- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index 5db8fa1..661f7f9 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -20,6 +20,8 @@ config NIOS2 select USB_ARCH_HAS_HCD if USB_SUPPORT select CPU_NO_EFFICIENT_FFS select HAVE_MEMBLOCK + select ARCH_DISCARD_MEMBLOCK + select NO_BOOTMEM config GENERIC_CSUM def_bool y diff --git a/arch/nios2/kernel/prom.c b/arch/nios2/kernel/prom.c index ba96a49..a6d4f75 100644 --- a/arch/nios2/kernel/prom.c +++ b/arch/nios2/kernel/prom.c @@ -32,13 +32,6 @@ #include -int __init early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, - bool nomap) -{ - reserve_bootmem(base, size, BOOTMEM_DEFAULT); - return 0; -} - void __init early_init_devtree(void *params) { __be32 *dtb = (u32 *)__dtb_start; diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index 0946840..2d0011d 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -144,10 +144,11 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, void __init setup_arch(char **cmdline_p) { - int bootmap_size; + int dram_start; console_verbose(); + dram_start = memblock_start_of_DRAM(); memory_size = memblock_phys_mem_size(); memory_start = PAGE_ALIGN((unsigned long)__pa(_end)); memory_end = (unsigned long) CONFIG_NIOS2_MEM_BASE + memory_size; @@ -165,39 +166,11 @@ void __init setup_arch(char **cmdline_p) max_low_pfn = PFN_DOWN(memory_end); max_mapnr = max_low_pfn; - /* - * give all the memory to the bootmap allocator, tell it to put the - * boot mem_map at the start of memory - */ - pr_debug("init_bootmem_node(?,%#lx, %#x, %#lx)\n", - min_low_pfn, PFN_DOWN(PHYS_OFFSET), max_low_pfn); - bootmap_size = init_bootmem_node(NODE_DATA(0), - min_low_pfn, PFN_DOWN(PHYS_OFFSET), - max_low_pfn); - - /* - * free the usable memory, we have to make sure we do not free - * the bootmem bitmap so we then reserve it after freeing it :-) - */ - pr_debug("free_bootmem(%#lx, %#lx)\n", - memory_start, memory_end - memory_start); - free_bootmem(memory_start, memory_end - memory_start); - - /* - * Reserve the bootmem bitmap itself as well. We do this in two - * steps (first step was init_bootmem()) because this catches - * the (very unlikely) case of us accidentally initializing the - * bootmem allocator with an invalid RAM area. - * - * Arguments are start, size - */ - pr_debug("reserve_bootmem(%#lx, %#x)\n", memory_start, bootmap_size); - reserve_bootmem(memory_start, bootmap_size, BOOTMEM_DEFAULT); - + memblock_reserve(dram_start, memory_start - dram_start); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) { - reserve_bootmem(virt_to_phys((void *)initrd_start), - initrd_end - initrd_start, BOOTMEM_DEFAULT); + memblock_reserve(virt_to_phys((void *)initrd_start), + initrd_end - initrd_start); } #endif /* CONFIG_BLK_DEV_INITRD */ -- 2.7.4