From patchwork Fri Jun 14 16:22:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 2722371 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 78099C0AB1 for ; Fri, 14 Jun 2013 16:23:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 638C420256 for ; Fri, 14 Jun 2013 16:23:20 +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 26D3320254 for ; Fri, 14 Jun 2013 16:23:19 +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 1UnWmO-0008V8-Eu; Fri, 14 Jun 2013 16:23:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UnWmL-0003h1-MU; Fri, 14 Jun 2013 16:23:09 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UnWmI-0003gU-FY for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2013 16:23:07 +0000 Received: from e106331-lin.cambridge.arm.com (e106331-lin.cambridge.arm.com [10.1.205.41]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id r5EGMPki019800; Fri, 14 Jun 2013 17:22:25 +0100 (BST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm: fix pmd flushing in map_init_section Date: Fri, 14 Jun 2013 17:22:22 +0100 Message-Id: <1371226942-3189-1-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.8.1.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130614_122306_779266_29F357FF X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -7.2 (-------) Cc: Mark Rutland , Christoffer Dall , Catalin Marinas , stable@vger.kernel.org, R Sricharan , Russell King 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 In e651eab0af: "ARM: 7677/1: LPAE: Fix mapping in alloc_init_section for unaligned addresses", the pmd flushing was broken when split out to map_init_section. At the end of the final iteration of the while loop, pmd will point at the pmd_t immediately after the pmds we updated, and thus flush_pmd_entry(pmd) won't flush the newly modified pmds. This has been observed to prevent an 11MPCore system from booting. This patch fixes this by remembering the address of the first pmd we update and using this as the argument to flush_pmd_entry. Signed-off-by: Mark Rutland Cc: R Sricharan Cc: Catalin Marinas Cc: Christoffer Dall Cc: Russell King Cc: stable@vger.kernel.org --- arch/arm/mm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e0d8565..22bc0ff 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -620,6 +620,7 @@ static void __init map_init_section(pmd_t *pmd, unsigned long addr, unsigned long end, phys_addr_t phys, const struct mem_type *type) { + pmd_t *p = pmd; #ifndef CONFIG_ARM_LPAE /* * In classic MMU format, puds and pmds are folded in to @@ -638,7 +639,7 @@ static void __init map_init_section(pmd_t *pmd, unsigned long addr, phys += SECTION_SIZE; } while (pmd++, addr += SECTION_SIZE, addr != end); - flush_pmd_entry(pmd); + flush_pmd_entry(p); } static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,