Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4125227yba; Tue, 23 Apr 2019 15:51:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx54rXFYub/5qBvzMXntBimbTSPrEQj1DbFln9ss9qUHqGXvwCpxbteZLWAM32+yIla3YG3 X-Received: by 2002:a65:648f:: with SMTP id e15mr27379633pgv.414.1556059872258; Tue, 23 Apr 2019 15:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556059872; cv=none; d=google.com; s=arc-20160816; b=GsjsEQuUlYI85qOG9HbpnpdgjSOevMQWsWg8jGDSwfAago2N1vQGmeMOHDDWkfjjc8 orEv09bMaH6DHOytq7oSFE8NeUkyaCc2kyZincyjW5a6H1goairlx2Cx2DzUFuNF6O6w N1Cju0emvjUwAYQaUDb1ofQbww1QXV7KWN8QE9gWeJLwiW96aoVel5IucvxnbWFFaX2E rJETJBvb9pKD8QsVLQ2FZ0U3PeWStoR0Dik45QKV0HVEP8XPvwgx3GlMq+JNZNWmxoSG bx7bpWFLE3sCEHec+mutqaT+nqN4BBUtaLFPTv7lFXEek21DM36DgneSe+AJSKKBTGLa nIrw== 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=W583DLuATb7569DJlQOwhhtkLZ1xhL86KTFMSp+wLl8=; b=McEKRyJUVZtBfuTNnbEX+jDE3oFpA9bA7ThWVaMQJQC/FCNef2U7ub2/7/oVAG3Y11 4DtSgUttZDy3oSkVJ6Z9jYP5NIesQTp4I3QeKr+t1b8Q/Cz0+H8EwP+nx9OVpKyi/PYd R8wjdX1KvaYrZCTBQ/suZGEQspH24frJkgjHJT/o0bE2pqYXSU6tvvHx5w1ZthjV22t6 pkZaVBqC8zLXkze8XdNWpFJZIJHF+8Zjy0A/pRtt20OMeXITTh/ZxZuv4biyK9t1B4eR LS3+sMzn215soFYeNEdwo9XI5Bm5atMmgpOPdqgeCn0wHKgmk95Ekct5co2WgkiWSzqv F6WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XTANTI43; 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 y4si15391540pgv.154.2019.04.23.15.50.56; Tue, 23 Apr 2019 15:51:12 -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=XTANTI43; 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 S1728845AbfDWWtw (ORCPT + 99 others); Tue, 23 Apr 2019 18:49:52 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34151 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728780AbfDWWtn (ORCPT ); Tue, 23 Apr 2019 18:49:43 -0400 Received: by mail-lf1-f65.google.com with SMTP id h5so13027069lfm.1; Tue, 23 Apr 2019 15:49:41 -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=W583DLuATb7569DJlQOwhhtkLZ1xhL86KTFMSp+wLl8=; b=XTANTI43m3AqXZ4watOgFQeVz3GWMCysvKAZ0BfLNAThnGYXFOUOqXPbpHlZ/b5mWF SxrGA7+nbNZj1x/pfWHhkJgxchG8jbokMXfnPvGcl5DWTPJ5TDsfnGehXJg2ibXkmGgX iVFNCL1BhDKT0FQNIMe3a23an6wwHEWm5qqpfs641NYNrpKZ5gSrtPSpqeQWjbk0T4lL DNNC596STlOWBaGvH6oOGVUAA5/xi1V0Be0f6biL51DarZiWJrqeUBhCnBQ23q+1gzS5 pppQo9LWICIxLxGfV7ncQ25IdC8ybOv5uDt1CTojMOsHdl1pPxpDXbRMVdZlh6qZlNbp ERIA== 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=W583DLuATb7569DJlQOwhhtkLZ1xhL86KTFMSp+wLl8=; b=Kykzn8KtXue4xJm7VEhEBgqk2hHVC9UXmXZVd6AdwVaiZydYM5yMjfrwzQgjoheH0v zk17oTccMiUMV9fGS7uGM7VX4xNfXDaUoMGhF3a4J0Z60k6BKBNYjA+t1gRC+jnaufOM HaQmFzf7Kks53JG3yKEVhbLMiKuTd+5ufXikNM5MgwbRhtq6pUJ4JLA71oTTSvJkp7eH UzcdiSOqP6hebC4XKL9N4bnVzq6HrLLwqeVh40MlMN3mbQ1h6F7omhVM9zchKcgK6PNq y02Tp1kxONQF8rkUHUYF0BJEzDLWU9pJYQu6gbsnSMuzNuSRm5cXvymkBk+HDhDn/loo 4gXQ== X-Gm-Message-State: APjAAAV151/GmvpiorYEKDpFLv93ilPBY9SRGVkPeckedoUixCyHpbMv 8MWMTcICWVUyRLC67ZokqVM= X-Received: by 2002:ac2:51d9:: with SMTP id u25mr4013003lfm.91.1556059781008; Tue, 23 Apr 2019 15:49:41 -0700 (PDT) Received: from localhost.localdomain ([5.164.240.123]) by smtp.gmail.com with ESMTPSA id w2sm4904722lfa.63.2019.04.23.15.49.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 15:49:40 -0700 (PDT) From: Serge Semin To: Ralf Baechle , Paul Burton , James Hogan , Matt Redfearn , Mike Rapoport , Andrew Morton , Michal Hocko , Greg Kroah-Hartman , Thomas Bogendoerfer , Huacai Chen , Stefan Agner , Stephen Rothwell , Alexandre Belloni , Juergen Gross Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Serge Semin Subject: [PATCH 12/12] mips: Enable OF_RESERVED_MEM config Date: Wed, 24 Apr 2019 01:47:48 +0300 Message-Id: <20190423224748.3765-13-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190423224748.3765-1-fancer.lancer@gmail.com> References: <20190423224748.3765-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 some of the features like private reserved memory pools aren't available at the moment, since OF_RESERVED_MEM isn't enabled for the MIPS platform. Lets fix it by enabling the config. 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 function call performed before bootmem_init() fails due to the lack of any memblock memory regions to allocate from at that stage. Signed-off-by: Serge Semin --- arch/mips/Kconfig | 1 + arch/mips/kernel/setup.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4a5f5b0ee9a9..0bf9e89e4023 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2988,6 +2988,7 @@ config USE_OF bool select OF select OF_EARLY_FLATTREE + select OF_RESERVED_MEM select IRQ_DOMAIN config UHI_BOOT 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