Skip to content

Commit c97100d

Browse files
committed
AOSCOS: mips, crash: wrap more crash dumping code into crash related ifdefs
In 85fcde4 ("kexec: split crashkernel reservation code out from crash_core.c"), crashk_res was moved from kernel/crash_core.c to kernel/crash_reserve.c. When CONFIG_CRASH_DUMP is set to no, CONFIG_CRASH_RESERVE won't be selected either, so kernel/crash_reserve.c will not be built. In d739f19 ("mips, crash: wrap crash dumping code into crash related ifdefs"), code using symbols in kernel/crash_reserve.c are optimized out by if (!IS_ENABLED(CONFIG_CRASH_RESERVE)) statements, adding another if statement to fix the symbol left behind. Fixes: 85fcde4 ("kexec: split crashkernel reservation code out from crash_core.c") Fixes: d739f19 ("mips, crash: wrap crash dumping code into crash related ifdefs") Fixes: "BACKPORT: FROMLIST: MIPS: Reserve extra memory for crash dump" Signed-off-by: Kexy Biscuit <[email protected]>
1 parent 421acb1 commit c97100d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/mips/kernel/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,9 @@ static void __init bootcmdline_init(void)
622622
* is more than 1GB, we reserve the top 128MB for the crash kernel */
623623
static void reserve_crashm_region(int node, unsigned long s0, unsigned long e0)
624624
{
625-
#ifdef CONFIG_KEXEC
625+
if (!IS_ENABLED(CONFIG_CRASH_RESERVE))
626+
return;
627+
626628
if (crashk_res.start == crashk_res.end)
627629
return;
628630

@@ -632,7 +634,6 @@ static void reserve_crashm_region(int node, unsigned long s0, unsigned long e0)
632634
s0 = e0 - (SZ_128M >> PAGE_SHIFT);
633635

634636
memblock_reserve(PFN_PHYS(s0), (e0 - s0) << PAGE_SHIFT);
635-
#endif
636637
}
637638

638639
static void reserve_oldmem_region(int node, unsigned long s0, unsigned long e0)

0 commit comments

Comments
 (0)