diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-24 05:14:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-24 05:15:17 +0200 |
commit | f24001941c99776f41bd3f09c07d91205c2ad9d4 (patch) | |
tree | 0ab31480ccdf343b61db045e195d096068ef7c73 /arch/arm/kernel/setup.c | |
parent | net: Use bool and remove inline in skb_splice_bits() code. (diff) | |
parent | Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmar... (diff) | |
download | linux-f24001941c99776f41bd3f09c07d91205c2ad9d4.tar.xz linux-f24001941c99776f41bd3f09c07d91205c2ad9d4.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Fix merge between commit 3adadc08cc1e ("net ax25: Reorder ax25_exit to
remove races") and commit 0ca7a4c87d27 ("net ax25: Simplify and
cleanup the ax25 sysctl handling")
The former moved around the sysctl register/unregister calls, the
later simply removed them.
With help from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b91411371ae1..ebfac782593f 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -523,7 +523,21 @@ int __init arm_add_memory(phys_addr_t start, unsigned long size) */ size -= start & ~PAGE_MASK; bank->start = PAGE_ALIGN(start); - bank->size = size & PAGE_MASK; + +#ifndef CONFIG_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); + /* + * To ensure bank->start + bank->size is representable in + * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB. + * This means we lose a page after masking. + */ + size = ULONG_MAX - bank->start; + } +#endif + + bank->size = size & PAGE_MASK; /* * Check whether this memory region has non-zero size or |