Skip to content

Commit 6d5fbec

Browse files
kylehendrydevtsbogend
authored andcommitted
MIPS: mm: Add check for highmem before removing memory block
If a device has less physical memory than the highmem threshold bootmem_init() doesn't set highstart_pfn. This results in highmem_init() wrongly disabling the entire memory range if the cpu doesn't support highmem. Add a check that highstart_pfn is non zero before removing the highmem block. Fixes: f171b55 ("mips: fix HIGHMEM initialization") Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent a9e0237 commit 6d5fbec

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/mips/mm/init.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,11 @@ static inline void __init highmem_init(void)
426426
unsigned long tmp;
427427

428428
/*
429-
* If CPU cannot support HIGHMEM discard the memory above highstart_pfn
429+
* If CPU cannot support HIGHMEM discard any memory above highstart_pfn
430430
*/
431431
if (cpu_has_dc_aliases) {
432-
memblock_remove(PFN_PHYS(highstart_pfn), -1);
432+
if (highstart_pfn)
433+
memblock_remove(PFN_PHYS(highstart_pfn), -1);
433434
return;
434435
}
435436

0 commit comments

Comments
 (0)