From patchwork Mon Mar 25 04:11:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 2328851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id E831EDF24C for ; Mon, 25 Mar 2013 04:14:30 +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 1UJykV-0005lG-7a; Mon, 25 Mar 2013 04:11:07 +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-0005hP-CC for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 04:10:42 +0000 X-AuditID: 9c930197-b7c9dae000006959-70-514fce3a72f2 Received: from js1304-P5Q-DELUXE.LGE.NET ( [10.177.220.249]) by LGEMRELSE7Q.lge.com (Symantec Brightmail Gateway) with SMTP id 74.9C.26969.A3ECF415; Mon, 25 Mar 2013 13:10:34 +0900 (KST) From: Joonsoo Kim To: Russell King Subject: [RFC PATCH 3/6] ARM, crashkernel: correct total_mem size in reserve_crashkernel() Date: Mon, 25 Mar 2013 13:11:11 +0900 Message-Id: <1364184674-13798-4-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_683098_B04A63C2 X-CRM114-Status: UNSURE ( 6.54 ) 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 There is some platforms which have highmem, so this equation doesn't represent total_mem size properly. In addition, max_low_pfn's meaning is different in other architecture and it is scheduled to be changed, so remove related code to max_low_pfn. Signed-off-by: Joonsoo Kim diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 99ffe87..1149988 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -655,14 +655,6 @@ static int __init init_machine_late(void) late_initcall(init_machine_late); #ifdef CONFIG_KEXEC -static inline unsigned long long get_total_mem(void) -{ - unsigned long total; - - total = max_low_pfn - min_low_pfn; - return total << PAGE_SHIFT; -} - /** * reserve_crashkernel() - reserves memory are for crash kernel * @@ -677,7 +669,7 @@ static void __init reserve_crashkernel(void) unsigned long limit = 0; int ret; - total_mem = get_total_mem(); + total_mem = memblock_phys_mem_size(); ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base); if (ret != 0 || crash_size == 0)