2013-04-25 08:02:20

by Jonghwan Choi

[permalink] [raw]
Subject: [PATCH 3.8-stable] ARM: 7690/1: mm: fix CONFIG_LPAE typos

This patch looks like it should be in the 3.8-stable tree, should we apply
it?

------------------

From: "Paul Bolle <[email protected]>"

commit 4e1db26a0b42e2b6e27c05d68adcc01709c2eed2 upstream

CONFIG_LPAE doesn't exist: the correct option is CONFIG_ARM_LPAE, so fix
up the two typos under arch/arm/.

The fix to head.S is slightly scary, but this is just for setting up
an early io-mapping for the serial port when running on a big-endian,
LPAE system. Since these systems don't exist in the wild (at least, I
have no access to one outside of kvmtool, which doesn't provide a serial
port suitable for earlyprintk), then we can revisit the code later if it
causes any problems.

Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Jonghwan Choi <[email protected]>
---
arch/arm/kernel/head.S | 2 +-
arch/arm/kernel/setup.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index e0eb9a1..8bac553 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -267,7 +267,7 @@ __create_page_tables:
addne r6, r6, #1 << SECTION_SHIFT
strne r6, [r3]

-#if defined(CONFIG_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
+#if defined(CONFIG_ARM_LPAE) && defined(CONFIG_CPU_ENDIAN_BE8)
sub r4, r4, #4 @ Fixup page table pointer
@ for 64-bit descriptors
#endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 3f6cbb2..62ead98 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -524,7 +524,7 @@ int __init arm_add_memory(phys_addr_t start, phys_addr_t
size)
size -= start & ~PAGE_MASK;
bank->start = PAGE_ALIGN(start);

-#ifndef CONFIG_LPAE
+#ifndef CONFIG_ARM_LPAE
if (bank->start + size < bank->start) {
printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
"32-bit physical address space\n", (long
long)start);
--
1.7.9.5


2013-04-25 08:20:48

by Paul Bolle

[permalink] [raw]
Subject: Re: [PATCH 3.8-stable] ARM: 7690/1: mm: fix CONFIG_LPAE typos

On Thu, 2013-04-25 at 17:02 +0900, Jonghwan Choi wrote:
> This patch looks like it should be in the 3.8-stable tree, should we apply
> it?

That would be only the setup.c chunk. That fixes a typo introduced in
v3.4 (see commit e5ab85800820edd907d3f43f285e1232f84d5a41
("ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic
MMU")). So, if that chunk is deemed appropriate for stable, you could
consider the v3.4.y longterm tree too.

(The typo in head.S was introduced in v3.9-rc2.)


Paul Bolle

2013-04-25 09:01:59

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 3.8-stable] ARM: 7690/1: mm: fix CONFIG_LPAE typos

On Thu, Apr 25, 2013 at 09:20:44AM +0100, Paul Bolle wrote:
> On Thu, 2013-04-25 at 17:02 +0900, Jonghwan Choi wrote:
> > This patch looks like it should be in the 3.8-stable tree, should we apply
> > it?
>
> That would be only the setup.c chunk. That fixes a typo introduced in
> v3.4 (see commit e5ab85800820edd907d3f43f285e1232f84d5a41
> ("ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic
> MMU")). So, if that chunk is deemed appropriate for stable, you could
> consider the v3.4.y longterm tree too.

Even then, I don't think it's worth backporting this patch. membank->start
and membank->size are phys_addr_t, so with LPAE enabled, this check won't
trigger anyway. The #ifndef is just there for readability really (since the
printk message explicitly refers to 32-bit physical addresses).

So I wouldn't bother with this.

Will