Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp836374yba; Fri, 3 May 2019 11:14:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL3recxj8uYmve33699euk0F4ZbylYEBw5p7Ulwzw8rlwnAqynH6utHloGt/0sJEjdbC82 X-Received: by 2002:a63:2b03:: with SMTP id r3mr11999339pgr.105.1556907282968; Fri, 03 May 2019 11:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556907282; cv=none; d=google.com; s=arc-20160816; b=Iw4WJSHKAvLeNiNqfbLgGDwvX1m5D/JyGLkMpGtlmk39+4wgcJfbZwzOT8hoiyQlVn Via0Pm9/2bNLvZ5b0qUDN1zkzSR5a0sYE2xpZcZ9IdxCzC2oCdq0p++0B2fsNpUT9zNN GaME3oaSZh933whYhzJSX5ENr5NLq/YfRjDK3mw3hjrUbcWI3eEApthWIaL6v4BBoe17 3lbZ/ek3qO9hQbuKi+ecy0DTOfG3ky88zyURqGz0lho2D3K1DiBhtyfodoB0J9D8TATX 1cNNzyQE7vtDhm4Lo3lew0Ke69iyMycUjEnXjd3K4m9eb5Yj0oC6/p1Hicpn+Y/ZMbmO Os9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JmSxHa0Jb+gcCHv31BEUSC8QaHpRnUhn+EbFUG/B/zA=; b=085D33iO2V57Mtx2zFkJAAIHRMUSJ+9HFUo9xmy+oZ3gsoh/1j7eeWRrMekFQK37Wj VCor/oMvyzWswlbYXx7H+xfve2j8Ib/UFoNO7PCPGd2uhpaD1ek5c4sMSCdlMRXAipHi MCeElWPsQxvZjgmm3vpthgj9nFXkX39eJfQ8VvIuaIlpJdndVZVS12c4U/ccjHNSt/zd 7uS8Xl2sJ+nfdmGLo2i+KGyLOHeiUhWRoANErHcLiYaBec+TN9aLjv6tsx1d0dGaqWrI v1O1b/V9rkS/ZlQajHPgGX/BiCCHSd6ISYGXuo08GikRqSSFcvzHbo0tlAkRB/n2Wugn rYBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ehXrGeYP; 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=QUARANTINE 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 g69si3161992pgc.408.2019.05.03.11.14.26; Fri, 03 May 2019 11:14:42 -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=pass header.i=@gmail.com header.s=20161025 header.b=ehXrGeYP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728858AbfECRvt (ORCPT + 99 others); Fri, 3 May 2019 13:51:49 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45222 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728830AbfECRvo (ORCPT ); Fri, 3 May 2019 13:51:44 -0400 Received: by mail-lj1-f194.google.com with SMTP id w12so5897809ljh.12; Fri, 03 May 2019 10:51:43 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=JmSxHa0Jb+gcCHv31BEUSC8QaHpRnUhn+EbFUG/B/zA=; b=ehXrGeYPBduAiAN+pYlJuxR9myOL9LkDT+SBeozR/GlcyWZD+SjafvDmIg7Jkw3E0C +kZ0GRGFXTD1h53u03Ffeaf4Wn48OSpvLm1hRB1pwlZBREvnSGqXyXsKTj5ODB/FxDAa +Mm0elBcIu/j3fHc5TrKjiEcZn9GmEcMMUJmEfZtx1oJQsR4Pm9s4utanTWa52cU9ceY ZTy4VVmK8ls6SruDF8oGDwT1oKETV6HoQhVC3c4GEBL1ORuhTEa9gPORT4nNuy7Wv1hL R5hjEeqeUB0KM2L3i0lD65nE1XI5dpMXWfWCJ0MALzpUED7XngZwiTEMgOpwHacz+wFk Km3Q== 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:mime-version:content-transfer-encoding; bh=JmSxHa0Jb+gcCHv31BEUSC8QaHpRnUhn+EbFUG/B/zA=; b=iIjyqUB5+85vz7zrqQzPrIfHwDwzl/N4I09bEYQND4WoCrmhLxFYT5TOUBqfDgY4ZA /tvWBBcYnl8hKpGsl2B3uEMnyPpFmNPgNYiaBAj+/JbS8+v2q4xW7yzlCOcS0EzylLs6 78UqFS2g6y90M9EgfdoUlld0LaD6A83GO/8uTvj/SeDJUFbDLGOHZY/xSMOW1ZdD+xGf yPJA/3pGXQ+DmN8IvNcyjsKo9xfUHMKEOHS3VehKawGNKM9OoI5oMGDmrmrSVOnWG5rs r3u8XBXrrmrMRbKF7Ky691+l9JYMv6MOxB4wp8x6VHEXazxyvdkZPwKc0JxQEwI+iDQy sskg== X-Gm-Message-State: APjAAAUzQeeFjeToV9aWFkE9eOV9WKwR4EwFlvI9AIBMD4IngZR2XiaA 5QP6Kv+PsPWrl1kSfHM3h1g= X-Received: by 2002:a2e:9e47:: with SMTP id g7mr5649130ljk.48.1556905902559; Fri, 03 May 2019 10:51:42 -0700 (PDT) Received: from localhost.localdomain ([5.164.217.122]) by smtp.gmail.com with ESMTPSA id z30sm533435lfb.87.2019.05.03.10.51.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 10:51:41 -0700 (PDT) From: Serge Semin To: Ralf Baechle , Paul Burton , James Hogan , Mike Rapoport , Andrew Morton , Michal Hocko , Greg Kroah-Hartman , Thomas Bogendoerfer , Huacai Chen , Stefan Agner , Stephen Rothwell , Alexandre Belloni , Juergen Gross Cc: Serge Semin , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] mips: Manually call fdt_init_reserved_mem() method Date: Fri, 3 May 2019 20:50:41 +0300 Message-Id: <20190503175041.7949-6-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503175041.7949-1-fancer.lancer@gmail.com> References: <20190503175041.7949-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since memblock-patchset was introduced the reserved-memory nodes are supported being declared in dt-files. So these nodes are actually parsed during the arch setup procedure when the early_init_fdt_scan_reserved_mem() method is called. But due to the arch-specific boot mem_map container utilization we need to manually call the fdt_init_reserved_mem() method after all the available and reserved memory has been moved to memblock. The first function call performed before bootmem_init() by the early_init_fdt_scan_reserved_mem() routine fails due to the lack of any memblock memory regions to allocate from at that stage. Signed-off-by: Serge Semin --- Changelog v2 - Discard forcible selection of OF_RESERVED_MEM config --- arch/mips/kernel/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index fbd216b4e929..ab349d2381c3 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -825,6 +826,8 @@ static void __init arch_mem_init(char **cmdline_p) memblock_reserve(__pa_symbol(&__nosave_begin), __pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin)); + fdt_init_reserved_mem(); + memblock_dump_all(); early_memtest(PFN_PHYS(min_low_pfn), PFN_PHYS(max_low_pfn)); -- 2.21.0