From patchwork Sat Feb 1 20:14:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 24000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 90904202B2 for ; Sat, 1 Feb 2014 20:15:37 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id k19sf3887206igc.3 for ; Sat, 01 Feb 2014 12:15:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=FURRlSPHJmwtwCgBH8eIAsY62141LZU67C+C1Kgk438=; b=Iqu5v4Od16szFeL6KaJQkfMpC116WSVrgpjVcGgcn4EuDyRbe4LAegUDtiSS5dpYty 7s6RumzwmkHCmm7DSwxrGVZR+UJnbVruaH/Hd41al+tM2KwhPhnJlBwrLC6DF31i2iCs p0YXJsgblKJfLnldYYX3LS/ahFpYTe5WK3CTBzzZwUXUalVP2qZ+Hn3WUuZA3WTvppus ode8NIhj4RIMufUrpAlUtlJGpbzrUg0fx6WWBCTWz8R2ruJAKvLvgQoxwunevVyh/Dps /SRSyYVkJpw9vxY1SehC//4+cLGzr7Di964snKpRf3orptkoBLbm3Yu5jMVZlk5w/jxB o8aQ== X-Gm-Message-State: ALoCoQkgOJaP2Rs2FQ4POk2SazhqYa6y/+JtQHbEkrnJPBZ63YqSuA87f1qRdg5Pkqpn+cvgvWbh X-Received: by 10.182.204.105 with SMTP id kx9mr10683506obc.34.1391285736674; Sat, 01 Feb 2014 12:15:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.102 with SMTP id a93ls1330209qga.33.gmail; Sat, 01 Feb 2014 12:15:36 -0800 (PST) X-Received: by 10.220.29.200 with SMTP id r8mr22047651vcc.9.1391285736581; Sat, 01 Feb 2014 12:15:36 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id a2si5101518vea.67.2014.02.01.12.15.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 12:15:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so3909845veb.26 for ; Sat, 01 Feb 2014 12:15:36 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr59319vcu.34.1391285736460; Sat, 01 Feb 2014 12:15:36 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp45185vcz; Sat, 1 Feb 2014 12:15:35 -0800 (PST) X-Received: by 10.68.164.4 with SMTP id ym4mr28529555pbb.53.1391285735485; Sat, 01 Feb 2014 12:15:35 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si15018304pbk.323.2014.02.01.12.15.34; Sat, 01 Feb 2014 12:15:34 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933215AbaBAUP2 (ORCPT + 27 others); Sat, 1 Feb 2014 15:15:28 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:59059 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932074AbaBAUP1 (ORCPT ); Sat, 1 Feb 2014 15:15:27 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s11KEpdA008838; Sat, 1 Feb 2014 14:14:51 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s11KEoBZ011152; Sat, 1 Feb 2014 14:14:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Sat, 1 Feb 2014 14:14:50 -0600 Received: from ula0393909.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s11KEoKA022966; Sat, 1 Feb 2014 14:14:50 -0600 From: Santosh Shilimkar To: CC: , Santosh Shilimkar , Yinghai Lu , Russell King , "Strashko, Grygorii" , Andrew Morton Subject: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines Date: Sat, 1 Feb 2014 15:14:47 -0500 Message-ID: <1391285687-20534-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: santosh.shilimkar@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit ad6492b8 added much needed memblock_virt_alloc_low() and further commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the issue with low memory limit thansk to Yinghai. But even after all these fixes, there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT for low memory fails. Russell pointed out the issue with 32 bit LPAE machines in below thread. https://lkml.org/lkml/2014/1/28/364 Since on some LPAE machines where memory start address is beyond 4GB, the low memory marker in memblock will be set to default ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting architectures set the ARCH_LOW_ADDRESS_LIMIT using another export similar to memblock_set_current_limit() but am not sure whether its worth the trouble. Tell me if you think otherwise. Rather am just trying to fix that one broken case using memblock_virt_alloc() in setup code since the memblock.current_limit is updated appropriately makes it work on all ARM 32 bit machines. Cc: Yinghai Lu Cc: Russell King Cc: Strashko, Grygorii Cc: Andrew Morton Signed-off-by: Santosh Shilimkar --- arch/arm/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b0df976..1e8b030 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc) kernel_data.end = virt_to_phys(_end - 1); for_each_memblock(memory, region) { - res = memblock_virt_alloc_low(sizeof(*res), 0); + res = memblock_virt_alloc(sizeof(*res), 0); res->name = "System RAM"; res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;