MIPS cmdline generation regression since 4.16
Hi Alexander,
Quoted 9 lines · Alexander Lobakin
Commit
8ce355cf2e38(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/mips/kernel/setup.c?id=8ce355cf2e38afdb364d03d12b23d9cf44c3b7f1)
has introduced a regression to cmdline setup.
As mentioned in description, platforms usually call__dt_setup_arch()inplat_mem_setup(). Prior to this commit we usually got cmdline args from DT
via this call toboot_command_line, and then the following part ofarch_mem_init()could expand or override it according to severalKconfig
options (CONFIG_MIPS_CMDLINE_DTB_EXTENDetc.).
But since the commit,plat_mem_setup()is called after this procedure, so
any__dt_setup_arch()calls will simply overwrite all that was done before
Quoted 8 lines
(as it uses
strlcpy()to fillboot_command_line, notstrlcat()). Additionally,arcs_cmdlineandboot_command_lineare likely to be empty now at start ofarch_mem_init(), becauseearly_init_dt_scan_chosen()(or anyfixup_fdt()) was not hit yet. This makes all the options likeCONFIG_MIPS_CMDLINE_DTB_EXTENDuseless and simply non-workable. The only way to restore old behaviour now is to call__dt_setup_arch()beforearch_mem_init(), e.g. atprom_init(), which is rather illogically. I think there might be better solutions.
Yes, I started working on a fix & aim to get it resolved for 4.19. I'll copy you on future submissions, and for reference here's the thread with the initial fix I submitted:
https://marc.info/?l=linux-mips&m=153668665809151&w=2
Thanks,
Paul