Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56bc6286 authored by Vitaly Andrianov's avatar Vitaly Andrianov Committed by Will Deacon
Browse files

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: default avatarVitaly Andrianov <vitalya@ti.com>
Signed-off-by: default avatarCyril Chemparathy <cyril@ti.com>
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: default avatarSubash Patel <subash.rp@samsung.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 20d6956d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ static inline void
free_memmap(unsigned long start_pfn, unsigned long end_pfn)
{
	struct page *start_pg, *end_pg;
	unsigned long pg, pgend;
	phys_addr_t pg, pgend;

	/*
	 * Convert start_pfn/end_pfn to a struct page pointer.
@@ -454,8 +454,8 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn)
	 * Convert to physical addresses, and
	 * round start upwards and end downwards.
	 */
	pg = (unsigned long)PAGE_ALIGN(__pa(start_pg));
	pgend = (unsigned long)__pa(end_pg) & PAGE_MASK;
	pg = PAGE_ALIGN(__pa(start_pg));
	pgend = __pa(end_pg) & PAGE_MASK;

	/*
	 * If there are free pages between these,