diff options
author | Hari Bathini <hbathini@linux.vnet.ibm.com> | 2017-05-22 15:04:23 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-06-02 20:16:35 +1000 |
commit | 81d9eca502fcc360950ef476124626d97856e139 (patch) | |
tree | 9f429c75a4630a0fd939c312bf3e64fcb432342a /arch/powerpc/kernel/fadump.c | |
parent | 98b8cd7f75643e0a442d7a4c1cef2c9d53b7e92b (diff) | |
download | linux-81d9eca502fcc360950ef476124626d97856e139.tar.bz2 |
powerpc/fadump: Add a warning when 'fadump_reserve_mem=' is used
With commit 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter
for fadump memory reservation"), 'fadump_reserve_mem=' parameter is
deprecated in favor of 'crashkernel=' parameter. Add a warning if
'fadump_reserve_mem=' is still used.
Fixes: 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter for fadump memory reservation")
Suggested-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[mpe: Unsplit long printk strings]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/fadump.c')
-rw-r--r-- | arch/powerpc/kernel/fadump.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 8a5d0e029b93..1bdbe0b257e0 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -212,6 +212,9 @@ static inline unsigned long fadump_calculate_reserve_size(void) int ret; unsigned long long base, size; + if (fw_dump.reserve_bootvar) + pr_warn("'fadump_reserve_mem=' parameter is deprecated in favor of 'crashkernel=' parameter.\n"); + /* * Check if the size is specified through crashkernel= cmdline * option. If yes, then use that but ignore base as fadump @@ -220,8 +223,17 @@ static inline unsigned long fadump_calculate_reserve_size(void) ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), &size, &base); if (ret == 0 && size > 0) { + if (fw_dump.reserve_bootvar) + pr_info("Using 'crashkernel=' parameter for memory reservation.\n"); + fw_dump.reserve_bootvar = (unsigned long)size; return fw_dump.reserve_bootvar; + } else if (fw_dump.reserve_bootvar) { + /* + * 'fadump_reserve_mem=' is being used to reserve memory + * for firmware-assisted dump. + */ + return fw_dump.reserve_bootvar; } /* divide by 20 to get 5% of value */ @@ -377,6 +389,19 @@ static int __init early_fadump_param(char *p) } early_param("fadump", early_fadump_param); +/* + * Look for fadump_reserve_mem= cmdline option + * TODO: Remove references to 'fadump_reserve_mem=' parameter, + * the sooner 'crashkernel=' parameter is accustomed to. + */ +static int __init early_fadump_reserve_mem(char *p) +{ + if (p) + fw_dump.reserve_bootvar = memparse(p, &p); + return 0; +} +early_param("fadump_reserve_mem", early_fadump_reserve_mem); + static int register_fw_dump(struct fadump_mem_struct *fdm) { int rc, err; |