From patchwork Fri Nov 30 13:04:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 1825351 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 302F6DF24C for ; Fri, 30 Nov 2012 13:08:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TeQHA-0004e7-VX; Fri, 30 Nov 2012 13:05:05 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TeQH4-0004dc-KY for linux-arm-kernel@lists.infradead.org; Fri, 30 Nov 2012 13:04:59 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAUD4vJo022570 for ; Fri, 30 Nov 2012 07:04:57 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAUD4vlS027139; Fri, 30 Nov 2012 07:04:57 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 30 Nov 2012 07:04:57 -0600 Received: from udb0794637 (udb0794637.am.dhcp.ti.com [158.218.103.33]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAUD4vVP001266; Fri, 30 Nov 2012 07:04:57 -0600 Received: from a0794637 by udb0794637 with local (Exim 4.76) (envelope-from ) id 1TeQH2-0007TN-1G; Fri, 30 Nov 2012 08:04:56 -0500 From: Vitaly Andrianov To: , Subject: [PATCH] arm: mm: lpae: add PTE loop to alloc_init_section Date: Fri, 30 Nov 2012 08:04:53 -0500 Message-ID: <1354280693-28696-1-git-send-email-vitalya@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121130_080459_029939_0D8A1777 X-CRM114-Status: GOOD ( 11.42 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 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: Vitaly Andrianov 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 Without enabled LPAE the alloc_init_pud never calls the alloc_init_section to map more then one segment. In that case the alloc_init_section doesn't need the loop when makes pte mapping. The loop is required when LPAE is enabled and alloc_init_pud may ask to map multiple sections. This patch adds the loop. Signed-off-by: Vitaly Andrianov --- arch/arm/mm/mmu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 2dbacf9..5ac134a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -614,11 +614,20 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr, flush_pmd_entry(p); } else { +#ifndef CONFIG_ARM_LPAE /* * No need to loop; pte's aren't interested in the * individual L1 entries. */ alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type); +#else + unsigned long next; + do { + next = pmd_addr_end(addr, end); + alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys), type); + phys += next - addr; + } while (pmd++, addr=next, addr != end); +#endif } }