Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4124959yba; Tue, 23 Apr 2019 15:50:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsrEiV9FqrsH47I4NqMdVPefIz4wdsgZHjlY9oQLvFOXDQbdeMsntalsZSh+pKafF7ZD9T X-Received: by 2002:a63:f503:: with SMTP id w3mr23591763pgh.60.1556059851199; Tue, 23 Apr 2019 15:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556059851; cv=none; d=google.com; s=arc-20160816; b=vyLFlpUYlfx4+Z7LrspCrDVf6mbbbWWsmLNM6gfeJKQt/8rPnKqkTBix7dDVqLt5rS Rv0TAAMguyUwVcBAOApLcphcAA8pSilG5WQTfuyHF39prjv/mNmspqbwROHaC30uTyZY TKHClv98Zq4C42+Vlq1LxNvqmJggUIi58ooLC21Bso6KMVjdw46TjpvsXOc9kAHIZXx7 Me4k9dSH3NVdLs8fMjMk1C3Qml1dRDy9vzVk02nRxavqt89fz0or+CR/hjd+cB7jHLYZ DAJZ+6i4nTd1Uhx8sB8BuJQ2RND/Sogvmj4x5Fj3YC8IPKLoKPYfV4aKpvK11PzT7SE2 RG9g== 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=aXXFjDICVLHmB6TL7TDcc/fdg+nH2204TOTWUCRzYEg=; b=qnXYuRfBfVuh6bra19+ybWw0YE9z4s+QqNR+8OaKe5ZW+ezUxf2ZxwsevCROsq6ohM 1aZLZr3NQbprflr+nBivL7qEXjvBCURpRWtNHJzNw95Xs8dvkm2EAB7h+K6Do10ot2ci DDYA4dDyc8xAsXiyllR23fdB5uLumBjnQ/+RJoV+Uw5j7b+MGxbVkD9QPxZzFeRqQDTV sJhGWqVkJ/6WbSIveSDzhN/qwXXiMaFuF9ilapx+t9k4UpQvP/Anj9mUIJ37xtoiFbga aJA2cwEfKQe7O57Ha+6QUu1rcoY6QgYLhJNMRxWiNUWnPz2k6A0if0xwDfIyZJIzSoCc 59ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OqY4f2Qg; 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 be8si16637895plb.72.2019.04.23.15.50.36; Tue, 23 Apr 2019 15:50:51 -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=OqY4f2Qg; 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 S1728714AbfDWWth (ORCPT + 99 others); Tue, 23 Apr 2019 18:49:37 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35418 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728604AbfDWWtd (ORCPT ); Tue, 23 Apr 2019 18:49:33 -0400 Received: by mail-lj1-f193.google.com with SMTP id t4so14996575ljc.2; Tue, 23 Apr 2019 15:49:32 -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=aXXFjDICVLHmB6TL7TDcc/fdg+nH2204TOTWUCRzYEg=; b=OqY4f2Qg+SvkuiMeosJuX95MfMFGoTNriaI6utt3x8o3I6xwPow4OO7gqYv/+llykL 62HjAu16vB65YXYjKFjdPf/DmuBCMoLS6fZPZucgFGZbfZ8w+OZJIbJyLjZBJ9M0Flqo wZJozoEXaNTEeUhOf5XZGkARNprGInv5w6NeCH90mU2x84vuL84AWFKovn32gRREPw5v 7TbODywdIAZKBO9sILxrnRAun/ziRqOa9jzv+7bAgtNtzkkmOHr3tKjo1i/c4TzDUCNk ZUT/WeIDla1x/uce1uLJUPf4gKMV7eu7Uzs66t5ExJGBOibFl6sp/N+yqKEGnsa+ec93 py3w== 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=aXXFjDICVLHmB6TL7TDcc/fdg+nH2204TOTWUCRzYEg=; b=J6l10NFoO8PR4FhzjV6w8V+31ywocCCphnQlFum8IU0unsydH3ztBaMGmFjwDIWI4c C2A8OC0LQ/OxtKW6zCOEyb873r2TpYXB9AkSKl9mBqD6rZrgnIMSsrE7N/25Ntwgajbb ZIfcuS1rIQXz4yD+itg/wlRYqeNJWW/4TRPu3emcGuJbpVctQ48AWxJ91d3T1niZAFTq i0BVRB2KuqodWVZmUeI8kai6fRWuxdVOvIyEQNQGAjROJGXR2IFRRed1fKb88aYlgXX+ dvHHpVX1LY3xsWnP9AZ28qyz4+h2wjMungjl8Tr/kz1v3cqj4Df/+IMlNWlKHMwLGEde vB8g== X-Gm-Message-State: APjAAAX6lQ2VekfofDYo0cHfriII7PRnKRJ+v6/86u3tgsHLPTUyAmzg e2hU0Z1DzEiAitYm+mPvpdQ= X-Received: by 2002:a2e:8057:: with SMTP id p23mr4560923ljg.33.1556059771521; Tue, 23 Apr 2019 15:49:31 -0700 (PDT) Received: from localhost.localdomain ([5.164.240.123]) by smtp.gmail.com with ESMTPSA id w2sm4904722lfa.63.2019.04.23.15.49.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 15:49:30 -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 06/12] mips: Use memblock to reserve the __nosave memory range Date: Wed, 24 Apr 2019 01:47:42 +0300 Message-Id: <20190423224748.3765-7-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 Originally before legacy bootmem was removed, the memory for the range was correctly reserved by reserve_bootmem_region(). But since memblock has been selected for early memory allocation the function can be utilized only after paging is fully initialized (as it is done by memblock_free_all() function). So calling it from arch_mem_init() method is prone to errors, and at this stage we need to reserve the memory in the memblock allocator. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 2ae6b02b948f..3a5140943f54 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -814,8 +814,9 @@ static void __init arch_mem_init(char **cmdline_p) dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); - reserve_bootmem_region(__pa_symbol(&__nosave_begin), - __pa_symbol(&__nosave_end)); /* Reserve for hibernation */ + /* Reserve for hibernation. */ + memblock_reserve(__pa_symbol(&__nosave_begin), + __pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin)); } static void __init resource_init(void) -- 2.21.0