@@ -368,10 +368,18 @@ static void __init reserve_crashkernel(void)
if (ret)
return;
- ret = memblock_reserve(crash_base, crash_size);
- if (ret < 0) {
+ /* 0 means: find the address automatically */
+ if (crash_base <= 0) {
+ crash_base = memblock_alloc(crash_size, 2 << 20);
+
+ if (!crash_base) {
+ pr_warn("Could not find free memory for
crashkernel\n");
+ return;
+ }
+
+ } else if (memblock_reserve(crash_base, crash_size) < 0) {
pr_warn("crashkernel reservation failed - memory is in
use (0x%lx)\n",
- (unsigned long)crash_base);
+ (unsigned long)crash_base);
return;