From patchwork Sun Aug 12 10:57:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 1309521 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 CCB703FC33 for ; Sun, 12 Aug 2012 11:04:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T0VtJ-0000Wp-91; Sun, 12 Aug 2012 10:59:29 +0000 Received: from caramon.arm.linux.org.uk ([78.32.30.218]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T0VtE-0000Wb-K1 for linux-arm-kernel@lists.infradead.org; Sun, 12 Aug 2012 10:59:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=iLgagb1AIFvQOl8gAQM9KyKd5SsyaZS+u2vuVIohoX8=; b=ZbrIe+iw/HuDZNlmIpqwNoTZCKn4pGweKW3GoX08KuJsL8SMEfyS/xs/levyoPOcnJrJTDTxpyFGWNapLfOLCket/FARNkrb05voyz7SpgQegeC4+3BaxOOoqE15kftkmyToQbsxH7kWPMscdZwfG7dGZZl7pyAdzv6fAe4J3dM=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:52979) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1T0Vr3-0001dy-VG; Sun, 12 Aug 2012 11:57:10 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1T0Vr3-0007XT-0b; Sun, 12 Aug 2012 11:57:09 +0100 Date: Sun, 12 Aug 2012 11:57:08 +0100 From: Russell King - ARM Linux To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Subject: [PATCH] Allow memblock steal operations to remove memory from anywhere Message-ID: <20120812105708.GD18957@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.1 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [78.32.30.218 listed in list.dnswl.org] -0.0 T_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] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Cc: Tony Lindgren , Sascha Hauer X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Found this with the cubox, which wants to obtain large blocks of RAM for the GPU and VPU devices at boot time. I don't believe any other platforms care where the memory comes from, so I think this is safe. However, OMAP and iMX folk should check this patch - thanks. 8<=== From: Russell King Subject: ARM: Allow arm_memblock_steal() to remove memory from any RAM region Allow arm_memblock_steal() to remove memory from any RAM region, including highmem areas. This allows memory to be stolen from the very top of declared memory, including highmem areas, rather than our precious lowmem. Signed-off-by: Russell King Acked-by: Sascha Hauer Acked-by: Santosh Shilimkar --- arch/arm/mm/init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index f54d592..04632f3 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) BUG_ON(!arm_memblock_steal_permitted); - phys = memblock_alloc(size, align); + phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE); memblock_free(phys, size); memblock_remove(phys, size);