|
@@ -1127,12 +1127,13 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
|
|
|
{
|
|
|
const u64 phys_offset = MIN_MEMBLOCK_ADDR;
|
|
|
|
|
|
+ if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {
|
|
|
+ pr_warn("Ignoring memory block 0x%llx - 0x%llx\n",
|
|
|
+ base, base + size);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!PAGE_ALIGNED(base)) {
|
|
|
- if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {
|
|
|
- pr_warn("Ignoring memory block 0x%llx - 0x%llx\n",
|
|
|
- base, base + size);
|
|
|
- return;
|
|
|
- }
|
|
|
size -= PAGE_SIZE - (base & ~PAGE_MASK);
|
|
|
base = PAGE_ALIGN(base);
|
|
|
}
|