diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2013-07-31 22:12:01 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-31 10:49:29 -0400 |
commit | 26ba47b18318abe7dadbe9294a611c0e932651d8 (patch) | |
tree | ab542f22462c683920457069bf95893252f42538 /arch/arm/mm | |
parent | 8e0cb8a1f6acf673ef9ab573087020ebafa8da51 (diff) |
ARM: 7805/1: mm: change max*pfn to include the physical offset of memory
Most of the kernel code assumes that max*pfn is maximum pfns because
the physical start of memory is expected to be PFN0. Since this
assumption is not true on ARM architectures, the meaning of max*pfn
is number of memory pages. This is done to keep drivers happy which
are making use of of these variable to calculate the dma bounce limit
using dma_mask.
Now since we have a architecture override possibility for DMAable
maximum pfns, lets make meaning of max*pfns as maximum pnfs on ARM
as well.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/init.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8aab24f35a5e..d50533c2b409 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -426,12 +426,10 @@ void __init bootmem_init(void) | |||
426 | * This doesn't seem to be used by the Linux memory manager any | 426 | * This doesn't seem to be used by the Linux memory manager any |
427 | * more, but is used by ll_rw_block. If we can get rid of it, we | 427 | * more, but is used by ll_rw_block. If we can get rid of it, we |
428 | * also get rid of some of the stuff above as well. | 428 | * also get rid of some of the stuff above as well. |
429 | * | ||
430 | * Note: max_low_pfn and max_pfn reflect the number of _pages_ in | ||
431 | * the system, not the maximum PFN. | ||
432 | */ | 429 | */ |
433 | max_low_pfn = max_low - PHYS_PFN_OFFSET; | 430 | min_low_pfn = min; |
434 | max_pfn = max_high - PHYS_PFN_OFFSET; | 431 | max_low_pfn = max_low; |
432 | max_pfn = max_high; | ||
435 | } | 433 | } |
436 | 434 | ||
437 | /* | 435 | /* |
@@ -537,7 +535,7 @@ static inline void free_area_high(unsigned long pfn, unsigned long end) | |||
537 | static void __init free_highpages(void) | 535 | static void __init free_highpages(void) |
538 | { | 536 | { |
539 | #ifdef CONFIG_HIGHMEM | 537 | #ifdef CONFIG_HIGHMEM |
540 | unsigned long max_low = max_low_pfn + PHYS_PFN_OFFSET; | 538 | unsigned long max_low = max_low_pfn; |
541 | struct memblock_region *mem, *res; | 539 | struct memblock_region *mem, *res; |
542 | 540 | ||
543 | /* set highmem page free */ | 541 | /* set highmem page free */ |