diff options
author | Vitaly Andrianov <vitalya@ti.com> | 2012-06-21 08:09:05 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-05-30 11:01:56 -0400 |
commit | 56bc628666b39dc8cb395c7686d8c032efd731f4 (patch) | |
tree | a45f9b91da92382f26fdb5f60db8a1aa98a96ff0 | |
parent | 20d6956d8cd2452cec0889ff040f18afc03c2e6b (diff) |
ARM: LPAE: use phys_addr_t in free_memmap()
The free_memmap() was mistakenly using unsigned long type to represent
physical addresses. This breaks on PAE systems where memory could be placed
above the 32-bit addressible limit.
This patch fixes this function to properly use phys_addr_t instead.
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Subash Patel <subash.rp@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm/mm/init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 9a5cdc01fcdf..68c914e8544e 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -442,7 +442,7 @@ static inline void | |||
442 | free_memmap(unsigned long start_pfn, unsigned long end_pfn) | 442 | free_memmap(unsigned long start_pfn, unsigned long end_pfn) |
443 | { | 443 | { |
444 | struct page *start_pg, *end_pg; | 444 | struct page *start_pg, *end_pg; |
445 | unsigned long pg, pgend; | 445 | phys_addr_t pg, pgend; |
446 | 446 | ||
447 | /* | 447 | /* |
448 | * Convert start_pfn/end_pfn to a struct page pointer. | 448 | * Convert start_pfn/end_pfn to a struct page pointer. |
@@ -454,8 +454,8 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn) | |||
454 | * Convert to physical addresses, and | 454 | * Convert to physical addresses, and |
455 | * round start upwards and end downwards. | 455 | * round start upwards and end downwards. |
456 | */ | 456 | */ |
457 | pg = (unsigned long)PAGE_ALIGN(__pa(start_pg)); | 457 | pg = PAGE_ALIGN(__pa(start_pg)); |
458 | pgend = (unsigned long)__pa(end_pg) & PAGE_MASK; | 458 | pgend = __pa(end_pg) & PAGE_MASK; |
459 | 459 | ||
460 | /* | 460 | /* |
461 | * If there are free pages between these, | 461 | * If there are free pages between these, |