Skip to content

Commit 7a22d63

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Update command line parsing for disable_radix
kernel parameter disable_radix takes different options disable_radix=yes|no|1|0 or just disable_radix. prom_init parsing is not supporting these options. Fixes: 1fd6c02 ("powerpc/mm: Add a CONFIG option to choose if radix is used by default") Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent cec4e9b commit 7a22d63

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

arch/powerpc/kernel/prom_init.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static unsigned long __initdata prom_tce_alloc_start;
171171
static unsigned long __initdata prom_tce_alloc_end;
172172
#endif
173173

174-
static bool __initdata prom_radix_disable;
174+
static bool prom_radix_disable __initdata = !IS_ENABLED(CONFIG_PPC_RADIX_MMU_DEFAULT);
175175

176176
struct platform_support {
177177
bool hash_mmu;
@@ -641,9 +641,19 @@ static void __init early_cmdline_parse(void)
641641

642642
opt = strstr(prom_cmd_line, "disable_radix");
643643
if (opt) {
644-
prom_debug("Radix disabled from cmdline\n");
645-
prom_radix_disable = true;
644+
opt += 13;
645+
if (*opt && *opt == '=') {
646+
bool val;
647+
648+
if (kstrtobool(++opt, &val))
649+
prom_radix_disable = false;
650+
else
651+
prom_radix_disable = val;
652+
} else
653+
prom_radix_disable = true;
646654
}
655+
if (prom_radix_disable)
656+
prom_debug("Radix disabled from cmdline\n");
647657
}
648658

649659
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)

arch/powerpc/kernel/prom_init_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
2020
_end enter_prom memcpy memset reloc_offset __secondary_hold
2121
__secondary_hold_acknowledge __secondary_hold_spinloop __start
22-
strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
22+
strcmp strcpy strlcpy strlen strncmp strstr kstrtobool logo_linux_clut224
2323
reloc_got2 kernstart_addr memstart_addr linux_banner _stext
2424
__prom_init_toc_start __prom_init_toc_end btext_setup_display TOC."
2525

0 commit comments

Comments
 (0)