diff options
author | Michal Simek <monstr@monstr.eu> | 2012-08-16 15:53:35 +0200 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2012-10-04 14:59:19 +0200 |
commit | fcc1c0ff2506cab8c3a019374550f68b3cbadcbe (patch) | |
tree | 5e78312ddff66318a7cd38fcaa92e48b7baaf5da /arch/microblaze/kernel/setup.c | |
parent | c7e9a211e22782af5857d265a83abf55619f19ea (diff) | |
download | linux-fcc1c0ff2506cab8c3a019374550f68b3cbadcbe.tar.bz2 |
microblaze: Fix bug with passing command line
When u-boot passes control over to Linux it places the Linux command
line between to the end of __init_end. When space between
__init_end and __bss_start is not COMMAND_LINE_SIZE then
the part of cmdline can be lost.
In extreme case if __init_end == __bss_start u-boot can't pass
any cmdline to Linux kernel.
This patch fix this issue by copying cmd line directly to
cmd_line char array which is placed in data section.
Reported-by: David Mc Andrew <david.mcandrew@xilinx.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/setup.c')
-rw-r--r-- | arch/microblaze/kernel/setup.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 4da971d4392f..9dbc9ecb28f1 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c @@ -40,7 +40,12 @@ DEFINE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DEFINE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ unsigned int boot_cpuid; -char cmd_line[COMMAND_LINE_SIZE]; +/* + * Placed cmd_line to .data section because can be initialized from + * ASM code. Default position is BSS section which is cleared + * in machine_early_init(). + */ +char cmd_line[COMMAND_LINE_SIZE] __attribute__ ((section(".data"))); void __init setup_arch(char **cmdline_p) { @@ -130,12 +135,6 @@ void __init machine_early_init(const char *cmdline, unsigned int ram, memset(__bss_start, 0, __bss_stop-__bss_start); memset(_ssbss, 0, _esbss-_ssbss); - /* Copy command line passed from bootloader */ -#ifndef CONFIG_CMDLINE_BOOL - if (cmdline && cmdline[0] != '\0') - strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE); -#endif - lockdep_init(); /* initialize device tree for usage in early_printk */ |