From patchwork Mon Mar 25 04:11:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 2328841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AAAF53FC54 for ; Mon, 25 Mar 2013 04:14:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJyko-0005nT-4C; Mon, 25 Mar 2013 04:11:26 +0000 Received: from lgemrelse7q.lge.com ([156.147.1.151]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJyk5-0005hO-AZ for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 04:10:42 +0000 X-AuditID: 9c930197-b7c9dae000006959-6b-514fce3958a7 Received: from js1304-P5Q-DELUXE.LGE.NET ( [10.177.220.249]) by LGEMRELSE7Q.lge.com (Symantec Brightmail Gateway) with SMTP id 73.9C.26969.93ECF415; Mon, 25 Mar 2013 13:10:34 +0900 (KST) From: Joonsoo Kim To: Russell King Subject: [RFC PATCH 2/6] ARM, crashkernel: use ___alloc_bootmem_node_nopanic() for reserving memory Date: Mon, 25 Mar 2013 13:11:10 +0900 Message-Id: <1364184674-13798-3-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364184674-13798-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1364184674-13798-1-git-send-email-iamjoonsoo.kim@lge.com> X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_001041_628054_2A0CF581 X-CRM114-Status: UNSURE ( 8.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.5 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [156.147.1.151 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Joonsoo Kim , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org For crashkernel, specific address should be reserved. It can be achived by reserve_bootmem(), but this function is only for bootmem. Now, we try to enable nobootmem, therfore change it more general function, ___alloc_bootmem_node_nopanic(). It can be use for both, bootmem and nobootmem. Signed-off-by: Joonsoo Kim diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b3990a3..99ffe87 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -674,15 +674,20 @@ static void __init reserve_crashkernel(void) { unsigned long long crash_size, crash_base; unsigned long long total_mem; + unsigned long limit = 0; int ret; total_mem = get_total_mem(); ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base); - if (ret) + if (ret != 0 || crash_size == 0) return; - ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); + if (crash_base != 0) + limit = crash_base + crash_size; + + ret = ___alloc_bootmem_node_nopanic(NODE_DATA(0), crash_size, + PAGE_ALIGN, crash_base, limit); if (ret < 0) { printk(KERN_WARNING "crashkernel reservation failed - " "memory is in use (0x%lx)\n", (unsigned long)crash_base);