All of lore.kernel.org
 help / color / mirror / Atom feed
From: ratbert.chuang@gmail.com (Po-Yu Chuang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: map_init_section flushes incorrect pmd
Date: Thu, 30 May 2013 19:46:00 +0800	[thread overview]
Message-ID: <1369914361-4237-1-git-send-email-ratbert.chuang@gmail.com> (raw)
In-Reply-To: <CANutaR_ZHWdXQrZNBN91K==n3taMKBptmyU0+8DT1RzBStNCyA@mail.gmail.com>

This bug was introduced in commit e651eab0.
Some v4/v5 platforms failed to boot due to this.

Signed-off-by: Po-Yu Chuang <ratbert.chuang@gmail.com>
---
v2:
prefix underscores to map_init_section to emphasize that it should never be
called by some random function.

 arch/arm/mm/mmu.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e0d8565..4d409e6 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -616,10 +616,12 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 }
 
-static void __init map_init_section(pmd_t *pmd, unsigned long addr,
+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 +640,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,
@@ -661,7 +663,7 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
 		 */
 		if (type->prot_sect &&
 				((addr | next | phys) & ~SECTION_MASK) == 0) {
-			map_init_section(pmd, addr, next, phys, type);
+			__map_init_section(pmd, addr, next, phys, type);
 		} else {
 			alloc_init_pte(pmd, addr, next,
 						__phys_to_pfn(phys), type);
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Po-Yu Chuang <ratbert.chuang@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk
Cc: linux-kernel@vger.kernel.org, will.deacon@arm.com,
	rob.herring@calxeda.com, catalin.marinas@arm.com,
	nico@linaro.org, r.sricharan@ti.com,
	Po-Yu Chuang <ratbert.chuang@gmail.com>
Subject: [PATCH v2] ARM: map_init_section flushes incorrect pmd
Date: Thu, 30 May 2013 19:46:00 +0800	[thread overview]
Message-ID: <1369914361-4237-1-git-send-email-ratbert.chuang@gmail.com> (raw)
In-Reply-To: <CANutaR_ZHWdXQrZNBN91K==n3taMKBptmyU0+8DT1RzBStNCyA@mail.gmail.com>

This bug was introduced in commit e651eab0.
Some v4/v5 platforms failed to boot due to this.

Signed-off-by: Po-Yu Chuang <ratbert.chuang@gmail.com>
---
v2:
prefix underscores to map_init_section to emphasize that it should never be
called by some random function.

 arch/arm/mm/mmu.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e0d8565..4d409e6 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -616,10 +616,12 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
 	} while (pte++, addr += PAGE_SIZE, addr != end);
 }
 
-static void __init map_init_section(pmd_t *pmd, unsigned long addr,
+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 +640,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,
@@ -661,7 +663,7 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr,
 		 */
 		if (type->prot_sect &&
 				((addr | next | phys) & ~SECTION_MASK) == 0) {
-			map_init_section(pmd, addr, next, phys, type);
+			__map_init_section(pmd, addr, next, phys, type);
 		} else {
 			alloc_init_pte(pmd, addr, next,
 						__phys_to_pfn(phys), type);
-- 
1.7.9.5


  reply	other threads:[~2013-05-30 11:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 10:48 [PATCH] ARM: map_init_section flushes incorrect pmd Po-Yu Chuang
2013-05-28 10:48 ` Po-Yu Chuang
2013-05-28 13:05 ` Will Deacon
2013-05-28 13:05   ` Will Deacon
2013-05-28 14:03   ` Sricharan R
2013-05-28 14:03     ` Sricharan R
2013-05-28 14:07     ` Will Deacon
2013-05-28 14:07       ` Will Deacon
2013-05-28 18:48       ` Sricharan R
2013-05-28 18:48         ` Sricharan R
2013-05-29  2:14         ` Po-Yu Chuang
2013-05-29  2:14           ` Po-Yu Chuang
2013-05-29  8:54           ` Will Deacon
2013-05-29  8:54             ` Will Deacon
2013-05-29  9:34             ` Po-Yu Chuang
2013-05-29  9:34               ` Po-Yu Chuang
2013-05-30  8:15               ` Po-Yu Chuang
2013-05-30  8:15                 ` Po-Yu Chuang
2013-05-30  9:12                 ` Will Deacon
2013-05-30  9:12                   ` Will Deacon
2013-05-30 11:33                   ` Po-Yu Chuang
2013-05-30 11:33                     ` Po-Yu Chuang
2013-05-30 11:46                     ` Po-Yu Chuang [this message]
2013-05-30 11:46                       ` [PATCH v2] " Po-Yu Chuang
2013-06-19 13:44                       ` Jonas Jensen
2013-06-19 13:44                         ` Jonas Jensen
2013-05-28 16:04   ` [PATCH] " Catalin Marinas
2013-05-28 16:04     ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369914361-4237-1-git-send-email-ratbert.chuang@gmail.com \
    --to=ratbert.chuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.