mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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: f171b55f14 ("mips: fix HIGHMEM initialization")
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
committed by
Thomas Bogendoerfer
parent
a9e0237d2e
commit
6d5fbecd02
+3
-2
@@ -426,10 +426,11 @@ static inline void __init highmem_init(void)
|
||||
unsigned long tmp;
|
||||
|
||||
/*
|
||||
* If CPU cannot support HIGHMEM discard the memory above highstart_pfn
|
||||
* If CPU cannot support HIGHMEM discard any memory above highstart_pfn
|
||||
*/
|
||||
if (cpu_has_dc_aliases) {
|
||||
memblock_remove(PFN_PHYS(highstart_pfn), -1);
|
||||
if (highstart_pfn)
|
||||
memblock_remove(PFN_PHYS(highstart_pfn), -1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user