Received: by 10.223.176.5 with SMTP id f5csp263332wra; Thu, 1 Feb 2018 19:57:35 -0800 (PST) X-Google-Smtp-Source: AH8x227vbSGmusXlj6YRac4dN4517Gf0/ZSKn5lENYe5GobEfZcICLBmtn3znulikv4raYFIzfUF X-Received: by 2002:a17:902:46a:: with SMTP id 97-v6mr33199586ple.96.1517543855197; Thu, 01 Feb 2018 19:57:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517543855; cv=none; d=google.com; s=arc-20160816; b=AXMKfX1M6x5U5uGrgs+hjwu1+V2xRN8mPOJIhZoIGTHw1jmmqjjk3IY6gIktKjCUTN HOaMGBvZSF1V81gUiBkEaQiMHZaLM0U5J4QkspUfRfDHLUXSjTzWMHJcgmt2mmldnSiM mlFhbRxX6plYVuM4oFEPVyqBqL8WoRNLbWweRU3y3wHU/OKqZ7DP+p/ZwEwvQWjMGE61 SEM5tfbSSUS/clF12bS4hvbtpiRYNe6Y14FqXopksJp4V62f0RcfD6K6PTr98QOZGaBH 3JuHAwMmNFD0wy85gejheFnb7IEogeR0shb08s7F8UBXkYYnJ1d4lh6E/K5nxhHSqhLD SVdg== 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:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Pc3tfGnvyG0fIEhCRUtvxswdiqOghm1Ne/BfkFPGIEM=; b=FclB4INGoa9o/cByuLnSF3dm0+GoGPdnpQMenJWbSOjSxImeUrGevp880NH77OSUjf C8sXrGI1jIAaxNvvtuD33H8LiST5xowdswqb76xYAeQYCdAX1FDJxEONmrgS2TXdY3kV magNiumpBIwNKuBmj3AA1BbqdwMt5QyxdEq/H5COibR68BeiFVw2l7dKZFjBx6vVJtnR hw4vqrYQOz9kMhUxBIf4nr56QKS+FDGL0gmrLe7eQrFyus/3FbYOIPlpnZ6L2AS4i+8u C0myO1rSGe1tKNHnjPhJ6kuF42oshyezS6CUkcYfzlfNwwTPWGrk3vz879ujF4rXUyBg VgSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NGYtG001; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si966485plr.656.2018.02.01.19.57.20; Thu, 01 Feb 2018 19:57:35 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=NGYtG001; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbeBBD4f (ORCPT + 99 others); Thu, 1 Feb 2018 22:56:35 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:45571 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbeBBDzX (ORCPT ); Thu, 1 Feb 2018 22:55:23 -0500 Received: by mail-lf0-f68.google.com with SMTP id x196so29417961lfd.12 for ; Thu, 01 Feb 2018 19:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pc3tfGnvyG0fIEhCRUtvxswdiqOghm1Ne/BfkFPGIEM=; b=NGYtG001ShrrWmGkyMKcJsNJPFkXon07bw0LcQfLMJyhu0y5eCQu5LXPvRVmE0t7FC uVLJf37DUBMoTUmoqgDfMcbAdo4Cm4sHUcv/6Tevk8x79gITxh2+voajZReNxICOXTAh +KBI2Q3dYjp1ignQD2kvssGVnkMV4q1BuSqCFCVdN8l7OUgB2KmV/v/hDFxT6auKPFEx IK33uivSoHpKQZ8rTDsRnD9uZo0/rln8fdYYRSfa+auvfz812CHDX0U/pXooG8Ey3cKR C9JiESYW74QKxsdHn1TWETlxISNIrVACtcZR9BXSJu7Jj6DqIm45LjjCwMg0ZDgAn5nn saYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Pc3tfGnvyG0fIEhCRUtvxswdiqOghm1Ne/BfkFPGIEM=; b=ebea2OnGmk4GUJxsNyHy8C6XI9T25TrIn6p2iPS2W/aBIohAkH0ySqXw0HM+YyPawG dknTsp6SGDrR6qPv+Xzl4zhW99lW0pp78nvxDhPVqsxePIImtbJecmZnPD5aGYM8r2VJ xN3UqtO2E8gKo0bXCxIazEQQsHrD2SszC/H3eYBha3YjDfmdzUFLB/W33K76nji6alXc iYBEC5Z8JWPDobm2c+TmsnRehHDHzBuQzmiGrTV6o7Vv8kTApRL6z0vgyFvfGmtKQR1I 7cJx0rH8AHooKp3F9sQpG/V+O1vlsq35D+1UFAdcqVVhJYS4uaYHnsxZ5d7nNnrSACWe 4K4Q== X-Gm-Message-State: AKwxytf91QACZBxemG8D7bDzbGFyxK5sbnGg8mtzEdRLvwMuwDgWDe1M fnyD1nx/1LHrR91wZEZZsgU= X-Received: by 10.46.71.211 with SMTP id u202mr21970203lja.56.1517543721800; Thu, 01 Feb 2018 19:55:21 -0800 (PST) Received: from linux.local ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id f14sm190934lje.84.2018.02.01.19.55.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Feb 2018 19:55:21 -0800 (PST) From: Serge Semin To: ralf@linux-mips.org, miodrag.dinic@mips.com, jhogan@kernel.org, goran.ferenc@mips.com, david.daney@cavium.com, paul.gortmaker@windriver.com, paul.burton@mips.com, alex.belits@cavium.com, Steven.Hill@cavium.com Cc: alexander.sverdlin@nokia.com, matt.redfearn@mips.com, kumba@gentoo.org, marcin.nowakowski@mips.com, James.hogan@mips.com, Peter.Wotton@mips.com, Sergey.Semin@t-platforms.ru, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Serge Semin Subject: [PATCH v2 14/15] MIPS: memblock: Discard bootmem from SGI IP27 code Date: Fri, 2 Feb 2018 06:54:57 +0300 Message-Id: <20180202035458.30456-15-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180202035458.30456-1-fancer.lancer@gmail.com> References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180202035458.30456-1-fancer.lancer@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGI IP27 got its own code to set the early memory allocator up since it's NUMA-based system. So in order to be compatible with NO_BOOTMEM config we need to discard the bootmem allocator initialization and insert the memblock reservation method. Although in my opinion the code isn't working anyway since I couldn't find a place where prom_meminit() called and kernel memory isn't reserved. It must have been untested since the time the arch/mips/mips-boards/generic code was in the kernel. Signed-off-by: Serge Semin --- arch/mips/sgi-ip27/ip27-memory.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c index 59133d0abc83..c480ee3eca96 100644 --- a/arch/mips/sgi-ip27/ip27-memory.c +++ b/arch/mips/sgi-ip27/ip27-memory.c @@ -389,7 +389,6 @@ static void __init node_mem_init(cnodeid_t node) { unsigned long slot_firstpfn = slot_getbasepfn(node, 0); unsigned long slot_freepfn = node_getfirstfree(node); - unsigned long bootmap_size; unsigned long start_pfn, end_pfn; get_pfn_range_for_nid(node, &start_pfn, &end_pfn); @@ -400,7 +399,6 @@ static void __init node_mem_init(cnodeid_t node) __node_data[node] = __va(slot_freepfn << PAGE_SHIFT); memset(__node_data[node], 0, PAGE_SIZE); - NODE_DATA(node)->bdata = &bootmem_node_data[node]; NODE_DATA(node)->node_start_pfn = start_pfn; NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn; @@ -409,12 +407,9 @@ static void __init node_mem_init(cnodeid_t node) slot_freepfn += PFN_UP(sizeof(struct pglist_data) + sizeof(struct hub_data)); - bootmap_size = init_bootmem_node(NODE_DATA(node), slot_freepfn, - start_pfn, end_pfn); free_bootmem_with_active_regions(node, end_pfn); - reserve_bootmem_node(NODE_DATA(node), slot_firstpfn << PAGE_SHIFT, - ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT) + bootmap_size, - BOOTMEM_DEFAULT); + memblock_reserve(slot_firstpfn << PAGE_SHIFT, + ((slot_freepfn - slot_firstpfn) << PAGE_SHIFT)); sparse_memory_present_with_active_regions(node); } -- 2.12.0