From patchwork Sat Jun 15 23:15:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 2727761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 274F99F8E4 for ; Sat, 15 Jun 2013 23:22:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17FC720172 for ; Sat, 15 Jun 2013 23:22:51 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22E142016D for ; Sat, 15 Jun 2013 23:22:50 +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 1Unznu-00055s-08; Sat, 15 Jun 2013 23:22:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Unznr-0004pz-9u; Sat, 15 Jun 2013 23:22:39 +0000 Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Unzno-0004p6-3e for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2013 23:22:37 +0000 Received: by mail-ee0-f45.google.com with SMTP id c1so1044506eek.4 for ; Sat, 15 Jun 2013 16:22:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=zrEzfuqfbM+zMiQm28OGKWrmsgWmbwM6rAPdeoUxukE=; b=DVR/+DTv6/bDktybzstbWYFgmfv94tTNTLJQyX9iUCw+TpupkQOfdBjJUGtlrkY+Ez 40tA5VhVbm0bzZvjm8XdmWxKPSgA4bjdBhVsLUxzU00PIRQ9yHdqUZkDzCC1T9Lbef0E p5q0l71nPzB4p4KLtUYkPaW/PThsccOa6MsNpprTk0I4EQt8/dK3pfgXThqqlqyPQc4g xw7zxp3uPEVhU51VsXIb9gAJ/7xkwFlPQUz6uQiRPbQNt5BQ3tyUeDBsRYZDieMsCYM4 6c1tUWYiCMrrzpoBYfbBsIUvg6r93KNrV5p7KefHEjYu/K2ks+/9xkoqM4zMs0SW/sKU Y8Hg== X-Received: by 10.14.203.194 with SMTP id f42mr9808055eeo.53.1371338111177; Sat, 15 Jun 2013 16:15:11 -0700 (PDT) Received: from localhost (host86-169-96-161.range86-169.btcentralplus.com. [86.169.96.161]) by mx.google.com with ESMTPSA id y44sm12951847eel.10.2013.06.15.16.15.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Jun 2013 16:15:10 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6D0D53E0A2E; Sun, 16 Jun 2013 00:15:09 +0100 (BST) From: Grant Likely To: Nicolas Pitre , Russell King Subject: [RFC] arm: Remove sa1111 special case from mm setup code Date: Sun, 16 Jun 2013 00:15:08 +0100 Message-Id: <1371338108-26354-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQlwpB8hEw0Dsr0mvpqLOpobR54XupvvCZ2yXDXfrDn2D4B5nMVvbV1sAYRol7lKTCIuO3Xt X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130615_192236_284199_EA8094EA X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -1.9 (-) Cc: Grant Likely , Catalin Marinas , Grant Likely , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 I don't think this special case is needed anymore. From what I can tell, setup_dma_zone() takes care of marking the region to be reserved for DMA, and that happens before arm_memblock_init() which calls arm_mm_memblock_reserve(). Therefore the mm setup should already know about the reserved region and it won't need to be explicitly reserved and then freed. That means the special case can be dropped from the common code. Signed-off-by: Grant Likely --- Hi Russell and Nicolas, I really don't know if this is correct. The MM code is not my strong area. Please take a look. Thanks, g. arch/arm/mm/init.c | 5 ----- arch/arm/mm/mmu.c | 8 -------- 2 files changed, 13 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 9a5cdc0..73212fe 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -598,11 +598,6 @@ void __init mem_init(void) totalram_pages += free_all_bootmem(); -#ifdef CONFIG_SA1111 - /* now that our DMA memory is actually so designated, we can free it */ - free_reserved_area(__va(PHYS_PFN_OFFSET), swapper_pg_dir, 0, NULL); -#endif - free_highpages(); reserved_pages = free_pages = 0; diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e0d8565..f281a24 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1147,14 +1147,6 @@ void __init arm_mm_memblock_reserve(void) * and can only be in node 0. */ memblock_reserve(__pa(swapper_pg_dir), SWAPPER_PG_DIR_SIZE); - -#ifdef CONFIG_SA1111 - /* - * Because of the SA1111 DMA bug, we want to preserve our - * precious DMA-able memory... - */ - memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET); -#endif } /*