From patchwork Mon Dec 9 16:35:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 3312071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 113AEC0D4A for ; Mon, 9 Dec 2013 16:38:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFC65202E9 for ; Mon, 9 Dec 2013 16:38:03 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 047D72017A for ; Mon, 9 Dec 2013 16:38:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vq3pe-0005nd-1D; Mon, 09 Dec 2013 16:37:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vq3pJ-0002V0-Aw; Mon, 09 Dec 2013 16:36:57 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vq3pF-0002SB-41 for linux-arm-kernel@lists.infradead.org; Mon, 09 Dec 2013 16:36:54 +0000 Received: by mail-la0-f41.google.com with SMTP id eo20so1786945lab.0 for ; Mon, 09 Dec 2013 08:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=bFbCwoCAoglBlc1nE9ZkeLWcbelYRi5+gT2ETTStu40=; b=wiiM2HTsKKELZ4v+ZTqHEqHFKp0/lkqQiVpsLuAX5bC1HNv2Ct3S3FZuSkJVOmjFIz 9OG1yQexuSSd9259QGQ2/DDHlfzbmonl4t7HmUBHIOuvBiOxHa9EWRIcOitnitDKt06V zwYUmwhkHuDuz2bQyPctAO+7lyT/t58JR5G2/SeZYjokNjLC0AxaRmFlJy9S6T1Tfttu DbLWnF0LL+GhzEBexpmMQgj8YiE7L08wdRJMkd2qcAVWmXubNYJ5zhtCXwXo11+7dSNM Oj+TDON21aI0yGQXZCIYCH96CPpWXIDwQRUNwVfXKI5O3DPpJJ3PRzzGQKvkjrThlxFF ka8w== X-Received: by 10.152.183.230 with SMTP id ep6mr379986lac.86.1386606989316; Mon, 09 Dec 2013 08:36:29 -0800 (PST) Received: from localhost ([83.220.237.186]) by mx.google.com with ESMTPSA id z3sm15599342lag.10.2013.12.09.08.36.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2013 08:36:28 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm: move arm_dma_limit to setup_dma_zone Date: Mon, 9 Dec 2013 17:35:45 +0100 Message-Id: <1386606945-2385-1-git-send-email-murzin.v@gmail.com> X-Mailer: git-send-email 1.8.1.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131209_113653_309949_5283802A X-CRM114-Status: GOOD ( 10.37 ) X-Spam-Score: -2.0 (--) Cc: linux@arm.linux.org.uk, nico@linaro.org, Vladimir Murzin , av1474@comtv.ru, akpm@linux-foundation.org, m.szyprowski@samsung.com 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 X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since 4dcfa600 (ARM: DMA-API: better handing of DMA masks for coherent allocations) arm_dma_limit_pfn has almost substituted the arm_dma_limit. The remaining user is dma_contiguous_reserve(). It is also referenced in setup_dma_zone() to calculate arm_dma_limit_pfn. Kill the global arm_dma_limit and equip setup_zone_dma with the local one. Reported-by: Vassili Karpov Signed-off-by: Vladimir Murzin --- arch/arm/mm/init.c | 6 ++++-- arch/arm/mm/mm.h | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 3e8f106..7583951 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -208,7 +208,6 @@ EXPORT_SYMBOL(arm_dma_zone_size); * allocations. This must be the smallest DMA mask in the system, * so a successful GFP_DMA allocation will always satisfy this. */ -phys_addr_t arm_dma_limit; unsigned long arm_dma_pfn_limit; static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, @@ -227,6 +226,8 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, void __init setup_dma_zone(const struct machine_desc *mdesc) { #ifdef CONFIG_ZONE_DMA + phys_addr_t arm_dma_limit; + if (mdesc->dma_zone_size) { arm_dma_zone_size = mdesc->dma_zone_size; arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; @@ -381,7 +382,8 @@ void __init arm_memblock_init(struct meminfo *mi, * reserve memory for DMA contigouos allocations, * must come from DMA area inside low memory */ - dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit)); + dma_contiguous_reserve(min((phys_addr_t)arm_dma_pfn_limit << PAGE_SHIFT, + arm_lowmem_limit)); arm_memblock_steal_permitted = false; memblock_allow_resize(); diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index d5a982d..11f3509 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h @@ -80,10 +80,8 @@ extern __init void add_static_vm_early(struct static_vm *svm); #endif #ifdef CONFIG_ZONE_DMA -extern phys_addr_t arm_dma_limit; extern unsigned long arm_dma_pfn_limit; #else -#define arm_dma_limit ((phys_addr_t)~0) #define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT) #endif