Received: by 10.223.148.5 with SMTP id 5csp6482762wrq; Wed, 17 Jan 2018 14:26:51 -0800 (PST) X-Google-Smtp-Source: ACJfBovybB06rveU3PMMM8mbAcLjzAPv1BKmH0q9tA6En3JwZ0D0kSGNxFu/Z2LBdCT+xmGLViG4 X-Received: by 10.159.216.151 with SMTP id s23mr8862917plp.238.1516228011656; Wed, 17 Jan 2018 14:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516228011; cv=none; d=google.com; s=arc-20160816; b=Cd5rg8lIi7ZtUevaCH8qU5aK7zZTKkDL1bRlYBH46EoFoFFbDGTETBKigxvJ0C+0uI Hl/Kb5C9YonCquRZ60cs04GGHuHNauXJ2CzAuVrGYq+lHSWpBi55QkyZeunEvoxxcuen eFS+sH8d5/cgzxc3E1G9uLkeKAJLI+HAa4jk+0g8jV2zPGjx6GfvGThWTxcPTpRge3Ko x3qGn7pN5nTbTcjDowfMRU8+y/MTDzrkjo99Ur6XYqj6nlV6+HjpJMEY6eyEA3+XvgBV dPhIWnUfDUNVwIKKd48l/ajPjaAEHoigUTawhDGt9S/vMK9l/cLZdfR0iS8aAgcH+9yZ IgDg== 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=MofHb4+HfYI85igX1XANA7SFdmsbUGWvRXh/9bwD6Nc=; b=k7QnMbsLjZJE10+qGvJBiaqedJpdKXvHxATZshCEOmddYxBUqtKhdJ5WO6wpmVWAe1 pbExHDMM8HPiB9KRLOTtY1RggAPC8sLms8LT28sCYZ45ysnUscA3cMkB8qzFoRYBtho0 6SknsnwxSUGNNqAVtt/MGDKdZ0s+WVwwWjEmrbkVBay0r84TviSSbbx6rJd4Zs+8UWkp BdEsD3j7YW4phhsaYGhvszHMxnvb7GTb7HPZdgJG7WlCeECgpTh3SuylOJ/fIjFfwk1s mRzEy8tDqSFQdD555cqh8vaPIxzwZ3Bi9TYwFoAX/7wS82vVbnn5pnFyv3Xo3CgXcnXn a12w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BLD21bLe; 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 bg5si5217456plb.822.2018.01.17.14.26.37; Wed, 17 Jan 2018 14:26:51 -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=BLD21bLe; 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 S1754627AbeAQWZ2 (ORCPT + 99 others); Wed, 17 Jan 2018 17:25:28 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:38681 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753812AbeAQWX3 (ORCPT ); Wed, 17 Jan 2018 17:23:29 -0500 Received: by mail-lf0-f67.google.com with SMTP id g72so18531210lfg.5 for ; Wed, 17 Jan 2018 14:23:29 -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=MofHb4+HfYI85igX1XANA7SFdmsbUGWvRXh/9bwD6Nc=; b=BLD21bLevcL9D6xxsBLq0qUl0oxFIHeFDoiFWSEzge47zXl51Jr7vZo1l1xtIgGHt/ OjN6g4pWzI+ZEA4jPbK/nKYHhTTOml7Eofsm/4++Fg6RyPPj9AZazs3pnY7AKAjGkaAM uQQclQ6fOkUg1NbAKRLsmYmi40P4eAy5/6kua+Npn+2/gxuprfqNZ4YBnLb/p8MaijeH +xSIY+xYFgr5UZ7SpqputuKGI4Lij4qeiLgGWdAi/bUsnJVsBQvjWPlzeXFkfg0sBH48 2k//ejFmFVZMm0VCpbXLbqBfx/h4dc+BZEhnUuVH7R4l7SY8rRxiWJpSPhTBBgUTtD8w N+bw== 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=MofHb4+HfYI85igX1XANA7SFdmsbUGWvRXh/9bwD6Nc=; b=cPbSbehFNSpobhItsTujNuKbmw6PcYTBtdBmHIF4x3cN0QUtaHJ/pDUZquSnJje5C8 5eDnpm0e2Uq2Y6YNzkr7Txt9SgWaFN9Akr2zuF6jnPbFzRTQ58CKekMZgv6jEZZaWno9 xuoKINmWmCXatPh1qDevwvFrtLUntSg93O2XTbW3HHkkhnQ/ma7ALQAf4AbsmPD1h9NU nHMABANAnrIdtf/T9gOpPWZ7j7d91MqnjBC3tfr+JQnBV3Mxsw7z/YLc/N+c2SafsFjD g9J0vME7HU5tK91vHX9pObsyxB3Jh5tZbqUhQqXAmCPLGt0S1ov6HK2Nx2/gjkypxvCh HG/w== X-Gm-Message-State: AKwxytdm8NjExugdDj+XgnfGUjOreiKuiR2y2x1GlF7ZnFyHzJnxOVV/ WxnwJyCwMKNuL6kjcSbfVI0= X-Received: by 10.46.27.10 with SMTP id b10mr9383488ljb.60.1516227808532; Wed, 17 Jan 2018 14:23:28 -0800 (PST) Received: from linux.local ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id l203sm953867lfb.59.2018.01.17.14.23.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Jan 2018 14:23:27 -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 07/14] MIPS: memblock: Mark present sparsemem sections Date: Thu, 18 Jan 2018 01:23:05 +0300 Message-Id: <20180117222312.14763-8-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180117222312.14763-1-fancer.lancer@gmail.com> References: <20180117222312.14763-1-fancer.lancer@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If sparsemem is activated all sections with present pages must be accordingly marked after memblock is fully initialized. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index b121fa702..6df1eaf38 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -778,7 +778,7 @@ static void __init request_crashkernel(struct resource *res) static void __init arch_mem_init(char **cmdline_p) { - struct memblock_region *reg; + struct memblock_region *reg __maybe_unused; extern void plat_mem_setup(void); /* call board setup routine */ @@ -860,6 +860,11 @@ static void __init arch_mem_init(char **cmdline_p) crashk_res.end - crashk_res.start + 1); #endif device_tree_init(); +#ifdef CONFIG_SPARSEMEM + for_each_memblock(memory, reg) + memory_present(0, memblock_region_memory_base_pfn(reg), + memblock_region_memory_end_pfn(reg)); +#endif /* CONFIG_SPARSEMEM */ sparse_init(); plat_swiotlb_setup(); -- 2.12.0