Skip to contentSkip to conversation

MIPS cmdline generation regression since 4.16

DISCUSSION Paul Burton 1 participant 1 message Sep 14, 2018 1 message not in the archive MIPS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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() in
plat_mem_setup(). Prior to this commit we usually got cmdline args from DT
via this call to boot_command_line, and then the following part of
arch_mem_init() could expand or override it according to several Kconfig
options (CONFIG_MIPS_CMDLINE_DTB_EXTEND etc.).
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 fill boot_command_line, not strlcat()). Additionally, arcs_cmdline and boot_command_line are likely to be empty now at start of arch_mem_init(), because early_init_dt_scan_chosen() (or any fixup_fdt()) was not hit yet. This makes all the options like CONFIG_MIPS_CMDLINE_DTB_EXTEND useless and simply non-workable. The only way to restore old behaviour now is to call __dt_setup_arch() before arch_mem_init(), e.g. at prom_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