Skip to content

Commit 85a1c77

Browse files
mperobherring
authored andcommitted
of: Print rather than WARN'ing when overlap check fails
__rmem_check_for_overlap() is called very early in boot, and on some powerpc systems it's not safe to call WARN that early in boot. If the overlap check fails the system will oops instead of printing a warning. Furthermore because it's so early in boot the console is not up and the user doesn't see the oops, they just get a dead system. Fix it by printing an error instead of calling WARN. Fixes: ae1add2 ("of: Check for overlap in reserved memory regions") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 87ab520 commit 85a1c77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/of/of_reserved_mem.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,9 @@ static void __init __rmem_check_for_overlap(void)
226226

227227
this_end = this->base + this->size;
228228
next_end = next->base + next->size;
229-
WARN(1,
230-
"Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
231-
this->name, &this->base, &this_end,
232-
next->name, &next->base, &next_end);
229+
pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
230+
this->name, &this->base, &this_end,
231+
next->name, &next->base, &next_end);
233232
}
234233
}
235234
}

0 commit comments

Comments
 (0)