Skip to contentSkip to conversation

arm: dt: Initialize boot_command_line from CONFIG_CMDLINE in case DT does not provide /chosen/bootargs

PATCH In review Pali Rohár 8 participants 22 messages Dec 14, 2016 – Jan 2, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: dt: Initialize boot_command_line from CONFIG_CMDLINE in case DT does not provide /chosen/bootargs

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

---
 arch/arm/kernel/devtree.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/kernel/devtree.c +5 -0
index f676feb..dbe25b1 100644
@@ -260,6 +260,11 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
 
 	early_init_dt_scan_nodes();
 
+#ifdef CONFIG_CMDLINE
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+
 	/* Change machine number to match the mdesc we're using */
 	__machine_arch_type = mdesc->nr;
 
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 5 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 14 lines
arch/arm/kernel/devtree.c +5 -0
@@ -260,6 +260,11 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
 
 	early_init_dt_scan_nodes();
 
+#ifdef CONFIG_CMDLINE
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+
 	/* Change machine number to match the mdesc we're using */
 	__machine_arch_type = mdesc->nr;
 
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161214/aa1fd45b/attachment.sig>
Acked-by
#2 lore raw
Quoted 9 lines · Pavel Machek
Quoted 8 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 7 lines
Quoted 5 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

#3 lore raw
In reply to Pali Rohár

Hello Pali,

Quoted 3 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

This commit really exposed the issue rather than causing it. But since it was working before due including skeleton.dtsi which defines an empty chosen node, I think that you should add a:

Fixes 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage")
Quoted 11 lines

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

---

Best regards,
Javier

#4 lore raw
In reply to Pali Rohár
Quoted 11 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Second, CONFIG_CMDLINE has never been in place on DT systems - it's something atags_parse.c has been dealing with which isn't involved on DT. For DT, we expect the command line to be passed in.

Now, given that, I find your commit message rather fishy. You seem to be claiming that CONFIG_CMDLINE used to work, but the fact is, we've never had it working on device tree systems.

Instead, what I think was going on is that the bug you're seeing is that the removal of skeleton.dtsi results in the /chosen node being absent, which in turn prevents the decompressor picking the various parameters out of the ATAGs and dropping them into the DT blob.

That, to me, sounds like a regression, and the fix is not to hack support for an unrelated feature, but to fix the original problem - and I think in this case, it's reasonable to ask for the offending commit to be reverted.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#5 lore raw
Quoted 16 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Hm... I did not think about it. But right this can be broken too...

Quoted 3 lines

Second, CONFIG_CMDLINE has never been in place on DT systems - it's something atags_parse.c has been dealing with which isn't involved on DT. For DT, we expect the command line to be passed in.

If cmdline is not in DT, but /chosen exists, then function early_init_dt_scan_chosen() use cmdline from CONFIG_CMDLINE.

Quoted 3 lines

Now, given that, I find your commit message rather fishy. You seem to be claiming that CONFIG_CMDLINE used to work, but the fact is, we've never had it working on device tree systems.

Looks like that CONFIG_CMDLINE really did not worked (correctly) on DT booted systems... We have already discussed about it on #armlinux

Quoted 4 lines

Instead, what I think was going on is that the bug you're seeing is that the removal of skeleton.dtsi results in the /chosen node being absent, which in turn prevents the decompressor picking the various parameters out of the ATAGs and dropping them into the DT blob.

In my case, bootloader did not provided any cmdline in ATAG, so decompressor did not parsed any cmdline...

Quoted 4 lines

That, to me, sounds like a regression, and the fix is not to hack support for an unrelated feature, but to fix the original problem - and I think in this case, it's reasonable to ask for the offending commit to be reverted.

I will let decision to others, who created and accepted that patch 008a2ebcd677. What I need is working CONFIG_CMDLINE as I had it before as bootloader for Nokia N900 does not pass any cmdline -- and without it I cannot boot userspace.

But still, I would like to see working CONFIG_CMDLINE support for DT systems. Other systems (e.g. arm ATAG based or x86) have it.

What is reason that CONFIG_CMDLINE is not supported for DT?

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161215/19624c67/attachment-0001.sig>
#6 lore raw
Quoted 55 lines · On Thu, 15 Dec 2016 01:09:20 +0100 Pali Roh?r <[email protected]> wrote:
Quoted 16 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Hm... I did not think about it. But right this can be broken too...

Quoted 3 lines

Second, CONFIG_CMDLINE has never been in place on DT systems - it's something atags_parse.c has been dealing with which isn't involved on DT. For DT, we expect the command line to be passed in.

If cmdline is not in DT, but /chosen exists, then function early_init_dt_scan_chosen() use cmdline from CONFIG_CMDLINE.

Quoted 3 lines

Now, given that, I find your commit message rather fishy. You seem to be claiming that CONFIG_CMDLINE used to work, but the fact is, we've never had it working on device tree systems.

Looks like that CONFIG_CMDLINE really did not worked (correctly) on DT booted systems... We have already discussed about it on #armlinux

Quoted 4 lines

Instead, what I think was going on is that the bug you're seeing is that the removal of skeleton.dtsi results in the /chosen node being absent, which in turn prevents the decompressor picking the various parameters out of the ATAGs and dropping them into the DT blob.

In my case, bootloader did not provided any cmdline in ATAG, so decompressor did not parsed any cmdline...

Quoted 4 lines

That, to me, sounds like a regression, and the fix is not to hack support for an unrelated feature, but to fix the original problem - and I think in this case, it's reasonable to ask for the offending commit to be reverted.

Quoted 4 lines

I will let decision to others, who created and accepted that patch 008a2ebcd677. What I need is working CONFIG_CMDLINE as I had it before as bootloader for Nokia N900 does not pass any cmdline -- and without it I cannot boot userspace.

Isn't that what CONFIG_CMDLINE_FORCE is for?

Or you could, y'know, just add a chosen node to the N900 DT to put it back in the same state as before...

Robin.

Quoted 5 lines

But still, I would like to see working CONFIG_CMDLINE support for DT systems. Other systems (e.g. arm ATAG based or x86) have it.

What is reason that CONFIG_CMDLINE is not supported for DT?

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#7 lore raw
In reply to Pali Rohár
Quoted 2 lines · Pali Roh?r

If cmdline is not in DT, but /chosen exists, then function early_init_dt_scan_chosen() use cmdline from CONFIG_CMDLINE.

Ah, yes. Looks to me then as if the bug exists there, and not in arch code then. early_init_dt_scan_chosen() completely ignores the CMDLINE options if the chosen node is not found.

Quoted 1 line

What is reason that CONFIG_CMDLINE is not supported for DT?

Sorry, that's my mistake - as you've pointed out above, it is supported but via generic code. I was only looking at arch code when I made the statement.

This patch (untested) should solve it:

 drivers/of/fdt.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/of/fdt.c +20 -20
index c89d5d231a0e..fb89157332c6 100644
@@ -1073,26 +1073,6 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
 	if (p != NULL && l > 0)
 		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
 
-	/*
-	 * CONFIG_CMDLINE is meant to be a default in case nothing else
-	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
-	 * is set in which case we override whatever was found earlier.
-	 */
-#ifdef CONFIG_CMDLINE
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(data, " ", COMMAND_LINE_SIZE);
-	strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
-	strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#else
-	/* No arguments from boot loader, use kernel's  cmdl*/
-	if (!((char *)data)[0])
-		strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#endif
-#endif /* CONFIG_CMDLINE */
-
-	pr_debug("Command line is: %s\n", (char*)data);
-
 	/* break now */
 	return 1;
 }
@@ -1205,6 +1185,26 @@ void __init early_init_dt_scan_nodes(void)
 	/* Retrieve various information from the /chosen node */
 	of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
 
+	/*
+	 * CONFIG_CMDLINE is meant to be a default in case nothing else
+	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
+	 * is set in which case we override whatever was found earlier.
+	 */
+#ifdef CONFIG_CMDLINE
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#elif defined(CONFIG_CMDLINE_FORCE)
+	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#else
+	/* No arguments from boot loader, use kernel's cmdline */
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+#endif /* CONFIG_CMDLINE */
+
+	pr_debug("Command line is: %s\n", boot_command_line);
+
 	/* Initialize {size,address}-cells info */
 	of_scan_flat_dt(early_init_dt_scan_root, NULL);
 
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#8 lore raw
Quoted 7 lines · On Thursday 15 December 2016 11:09:32 Russell King - ARM Linux wrote:
Quoted 2 lines · Pali Roh?r

If cmdline is not in DT, but /chosen exists, then function early_init_dt_scan_chosen() use cmdline from CONFIG_CMDLINE.

Ah, yes. Looks to me then as if the bug exists there, and not in arch code then. early_init_dt_scan_chosen() completely ignores the CMDLINE options if the chosen node is not found.

Yes... but question is: shoud function named early_init_dt_scan_chosen() use CONFIG_CMDLINE if there is DT entry? From name dt_scan_chosen I would expect that it scan /chosen and set some fields from /chosen...

At least name of that function is confusing.

Quoted 58 lines
Quoted 1 line

What is reason that CONFIG_CMDLINE is not supported for DT?

Sorry, that's my mistake - as you've pointed out above, it is supported but via generic code. I was only looking at arch code when I made the statement.

This patch (untested) should solve it:

 drivers/of/fdt.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/of/fdt.c +12 -20
index c89d5d231a0e..fb89157332c6 100644
@@ -1073,26 +1073,6 @@ int __init early_init_dt_scan_chosen(unsigned
 long node, const char *uname, if (p != NULL && l > 0)
 		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
 
-	/*
-	 * CONFIG_CMDLINE is meant to be a default in case nothing else
-	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
-	 * is set in which case we override whatever was found earlier.
-	 */
-#ifdef CONFIG_CMDLINE
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(data, " ", COMMAND_LINE_SIZE);
-	strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
-	strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#else
-	/* No arguments from boot loader, use kernel's  cmdl*/
-	if (!((char *)data)[0])
-		strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#endif
-#endif /* CONFIG_CMDLINE */
-
-	pr_debug("Command line is: %s\n", (char*)data);
-
 	/* break now */
 	return 1;
 }
@@ -1205,6 +1185,26 @@ void __init early_init_dt_scan_nodes(void)
 	/* Retrieve various information from the /chosen node */
 	of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
 
+	/*
+	 * CONFIG_CMDLINE is meant to be a default in case nothing else
+	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
+	 * is set in which case we override whatever was found earlier.
+	 */
+#ifdef CONFIG_CMDLINE
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#elif defined(CONFIG_CMDLINE_FORCE)
+	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#else

drivers/of/fdt.c void __init early_init_dt_scan_nodes(void) · line 1209

Quoted 10 lines
drivers/of/fdt.c +8 -0
+	/* No arguments from boot loader, use kernel's cmdline */
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+#endif /* CONFIG_CMDLINE */
+
+	pr_debug("Command line is: %s\n", boot_command_line);
+
 	/* Initialize {size,address}-cells info */
 	of_scan_flat_dt(early_init_dt_scan_root, NULL);

Patch is working fine and fixes my problem. You can add my Tested-by.

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161216/bfd7ea52/attachment.sig>
#11 lore raw
In reply to Pali Rohár
Quoted 19 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:
Quoted 18 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

This looks like a hack.

Quoted 8 lines
Quoted 6 lines

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161216/cf408722/attachment.sig>
#12 lore raw

Hello Pali,

Quoted 27 lines · Pali Roh?r
Quoted 26 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:
Quoted 24 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Quoted 7 lines
Quoted 1 line

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

I don't think reverting the mentioned commit is the correct fix for your problem. We are trying to get rid of skeleton.dtsi for many reasons, see commit commit ("3ebee5a2e141 arm64: dts: kill skeleton.dtsi").

Also, the chosen node is mentioned to be optional in the ePAPR document and u-boot creates a chosen node if isn't found [0] so this issue is only present in boards that don't use u-boot like the N900/N950/N9 phones.

So if NOLO doesn't do the same than u-boot and the kernel expects a chosen node, I suggest to add an empty chosen node in the omap3-n900.dts and omap3-n950-n9.dtsi device tree source files.

[0]: http://git.denx.de/?p=u-boot.git;a=blob;f=common/fdt_support.c;h=c9f7019e38e8de1469f506cdd57353fd27d8e134;hb=HEAD#l226

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#13 lore raw

Hi!

Quoted 36 lines · On Friday 16 December 2016 13:13:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 33 lines · Pali Roh?r
Quoted 27 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:
Quoted 16 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Quoted 2 lines

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

Quoted 7 lines
Quoted 2 lines

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

I don't think reverting the mentioned commit is the correct fix for your problem. We are trying to get rid of skeleton.dtsi for many reasons, see commit commit ("3ebee5a2e141 arm64: dts: kill skeleton.dtsi").

$ git show 3ebee5a2e141

* The default empty /chosen and /aliases are somewhat useless...

That is not truth, they are not useless as Russell King wrote -- removing them break ATAG support.

(But that commit is for arm64 which probably is not using ATAGs... But I do not know. At least it is not truth for 32bit arm.)

Quoted 4 lines

Also, the chosen node is mentioned to be optional in the ePAPR document and u-boot creates a chosen node if isn't found [0] so this issue is only present in boards that don't use u-boot like the N900/N950/N9 phones.

Linux arm decompressor does not propagate ATAGs when /chosen is missing. Sorry, but if for Linux /chosen is required (and without it is broken!) then some ePARP document does not apply there. Either Linux code needs to be fixed (so /chosen will be really only optional) or /chosen stay in Linux required. There is no other option.

And I hope that U-boot is not the only one bootloader which Linux kernel supports. I thought that I can use *any* bootloader to boot Linux kernel not just U-Boot which is doing some magic...

With this step you are basically going to break booting Linux kernel with all others bootloaders... And personally I really dislike this idea.

Quoted 3 lines

So if NOLO doesn't do the same than u-boot and the kernel expects a chosen node, I suggest to add an empty chosen node in the omap3-n900.dts and omap3-n950-n9.dtsi device tree source files.

That would fix a problem for N900, N950 and N9. But not for all other ARM devices which bootloader pass some ATAGs.

IIRC rule of kernel is not to break compatibility and that commit 008a2ebcd677 really did it.

Note: I'm not saying if 008a2ebcd677 is good or bad. I'm just saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

Quoted 5 lines

[0]:
http://git.denx.de/?p=u-boot.git;a=blob;f=common/fdt_support.c;h=c9f
7019e38e8de1469f506cdd57353fd27d8e134;hb=HEAD#l226

Best regards,

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161216/e81662a3/attachment-0001.sig>
#14 lore raw

Hello Pali,

Quoted 83 lines · Pali Roh?r

Hi!

Quoted 36 lines · On Friday 16 December 2016 13:13:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 33 lines · Pali Roh?r
Quoted 27 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:
Quoted 16 lines · On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Quoted 2 lines

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

Quoted 7 lines
Quoted 2 lines

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

I don't think reverting the mentioned commit is the correct fix for your problem. We are trying to get rid of skeleton.dtsi for many reasons, see commit commit ("3ebee5a2e141 arm64: dts: kill skeleton.dtsi").

$ git show 3ebee5a2e141

* The default empty /chosen and /aliases are somewhat useless...

That is not truth, they are not useless as Russell King wrote -- removing them break ATAG support.

(But that commit is for arm64 which probably is not using ATAGs... But I do not know. At least it is not truth for 32bit arm.)

Quoted 4 lines

Also, the chosen node is mentioned to be optional in the ePAPR document and u-boot creates a chosen node if isn't found [0] so this issue is only present in boards that don't use u-boot like the N900/N950/N9 phones.

Linux arm decompressor does not propagate ATAGs when /chosen is missing. Sorry, but if for Linux /chosen is required (and without it is broken!) then some ePARP document does not apply there. Either Linux code needs to be fixed (so /chosen will be really only optional) or /chosen stay in Linux required. There is no other option.

And I hope that U-boot is not the only one bootloader which Linux kernel supports. I thought that I can use *any* bootloader to boot Linux kernel not just U-Boot which is doing some magic...

With this step you are basically going to break booting Linux kernel with all others bootloaders... And personally I really dislike this idea.

Quoted 3 lines

So if NOLO doesn't do the same than u-boot and the kernel expects a chosen node, I suggest to add an empty chosen node in the omap3-n900.dts and omap3-n950-n9.dtsi device tree source files.

That would fix a problem for N900, N950 and N9. But not for all other ARM devices which bootloader pass some ATAGs.

Quoted 8 lines

IIRC rule of kernel is not to break compatibility and that commit 008a2ebcd677 really did it.

Note: I'm not saying if 008a2ebcd677 is good or bad. I'm just saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Quoted 6 lines
Quoted 5 lines

[0]:
http://git.denx.de/?p=u-boot.git;a=blob;f=common/fdt_support.c;h=c9f
7019e38e8de1469f506cdd57353fd27d8e134;hb=HEAD#l226

Best regards,

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#15 lore raw
Quoted 97 lines · On Friday 16 December 2016 13:38:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 85 lines · Pali Roh?r

Hi!

Quoted 37 lines · On Friday 16 December 2016 13:13:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 34 lines · Pali Roh?r
Quoted 28 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:

On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux

Quoted 16 lines · wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Quoted 2 lines

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

Quoted 7 lines
Quoted 2 lines

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

I don't think reverting the mentioned commit is the correct fix for your problem. We are trying to get rid of skeleton.dtsi for many reasons, see commit commit ("3ebee5a2e141 arm64: dts: kill skeleton.dtsi").

$ git show 3ebee5a2e141

* The default empty /chosen and /aliases are somewhat useless...

That is not truth, they are not useless as Russell King wrote -- removing them break ATAG support.

(But that commit is for arm64 which probably is not using ATAGs... But I do not know. At least it is not truth for 32bit arm.)

Quoted 4 lines

Also, the chosen node is mentioned to be optional in the ePAPR document and u-boot creates a chosen node if isn't found [0] so this issue is only present in boards that don't use u-boot like the N900/N950/N9 phones.

Linux arm decompressor does not propagate ATAGs when /chosen is missing. Sorry, but if for Linux /chosen is required (and without it is broken!) then some ePARP document does not apply there. Either Linux code needs to be fixed (so /chosen will be really only optional) or /chosen stay in Linux required. There is no other option.

And I hope that U-boot is not the only one bootloader which Linux kernel supports. I thought that I can use *any* bootloader to boot Linux kernel not just U-Boot which is doing some magic...

With this step you are basically going to break booting Linux kernel with all others bootloaders... And personally I really dislike this idea.

Quoted 3 lines

So if NOLO doesn't do the same than u-boot and the kernel expects a chosen node, I suggest to add an empty chosen node in the omap3-n900.dts and omap3-n950-n9.dtsi device tree source files.

That would fix a problem for N900, N950 and N9. But not for all other ARM devices which bootloader pass some ATAGs.

Quoted 8 lines

IIRC rule of kernel is not to break compatibility and that commit 008a2ebcd677 really did it.

Note: I'm not saying if 008a2ebcd677 is good or bad. I'm just saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

Quoted 5 lines

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

[0]:
http://git.denx.de/?p=u-boot.git;a=blob;f=common/fdt_support.c;h=c
9f 7019e38e8de1469f506cdd57353fd27d8e134;hb=HEAD#l226

Best regards,

Best regards,

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161216/debc8ab2/attachment.sig>
#16 lore raw

Hello Pali,

Quoted 98 lines · Pali Roh?r
Quoted 97 lines · On Friday 16 December 2016 13:38:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 93 lines · Pali Roh?r

Hi!

Quoted 37 lines · On Friday 16 December 2016 13:13:34 Javier Martinez Canillas wrote:

Hello Pali,

Quoted 34 lines · Pali Roh?r
Quoted 28 lines · On Thursday 15 December 2016 01:09:20 Pali Roh?r wrote:

On Thursday 15 December 2016 00:52:24 Russell King - ARM Linux

Quoted 16 lines · wrote:
Quoted 10 lines · Pali Roh?r

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function early_init_dt_scan_chosen() and that function does not fill variable boot_command_line when DTB does not contain /chosen entry. It is called from function early_init_dt_scan_nodes() in setup_machine_fdt().

Quoted 4 lines

This patch fixes it by explicitly filling boot_command_line in function setup_machine_fdt() after calling early_init_dt_scan_nodes() in case boot_command_line still remains empty.

Quoted 8 lines

This looks like a hack.

First, the matter of the ATAGs compatibility. The decompressor relies on there being a pre-existing /chosen node to insert the command line and other parameters into. If we've dropped it (by dropping skeleton.dtsi) then we've just regressed more than just N900 - the decompressor won't be able to merge the ATAGs into the concatenated FDT.

Quoted 2 lines

Hm... I did not think about it. But right this can be broken too...

Tony, Javier: are you aware of above ??? problem?

Quoted 7 lines
Quoted 2 lines

It looks like commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") should be really reverted.

I don't think reverting the mentioned commit is the correct fix for your problem. We are trying to get rid of skeleton.dtsi for many reasons, see commit commit ("3ebee5a2e141 arm64: dts: kill skeleton.dtsi").

$ git show 3ebee5a2e141

* The default empty /chosen and /aliases are somewhat useless...

That is not truth, they are not useless as Russell King wrote -- removing them break ATAG support.

(But that commit is for arm64 which probably is not using ATAGs... But I do not know. At least it is not truth for 32bit arm.)

Quoted 4 lines

Also, the chosen node is mentioned to be optional in the ePAPR document and u-boot creates a chosen node if isn't found [0] so this issue is only present in boards that don't use u-boot like the N900/N950/N9 phones.

Linux arm decompressor does not propagate ATAGs when /chosen is missing. Sorry, but if for Linux /chosen is required (and without it is broken!) then some ePARP document does not apply there. Either Linux code needs to be fixed (so /chosen will be really only optional) or /chosen stay in Linux required. There is no other option.

And I hope that U-boot is not the only one bootloader which Linux kernel supports. I thought that I can use *any* bootloader to boot Linux kernel not just U-Boot which is doing some magic...

With this step you are basically going to break booting Linux kernel with all others bootloaders... And personally I really dislike this idea.

Quoted 3 lines

So if NOLO doesn't do the same than u-boot and the kernel expects a chosen node, I suggest to add an empty chosen node in the omap3-n900.dts and omap3-n950-n9.dtsi device tree source files.

That would fix a problem for N900, N950 and N9. But not for all other ARM devices which bootloader pass some ATAGs.

IIRC rule of kernel is not to break compatibility and that commit 008a2ebcd677 really did it.

Note: I'm not saying if 008a2ebcd677 is good or bad. I'm just saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

Quoted 9 lines
Quoted 5 lines

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Yes, but you were talking about commit 008a2ebcd677 which only removed skeleton.dtsi usage for OMAP3 boards. The same can be done for other SoCs in its top level dtsi for the SoC family of course.

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

[0]:
http://git.denx.de/?p=u-boot.git;a=blob;f=common/fdt_support.c;h=c
9f 7019e38e8de1469f506cdd57353fd27d8e134;hb=HEAD#l226

Best regards,

Best regards,

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#17 lore raw
Quoted 12 lines · Javier Martinez Canillas
Quoted 11 lines · Pali Roh?r
Quoted 10 lines
Quoted 4 lines

saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Quoted 7 lines
Quoted 3 lines

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Yes, but you were talking about commit 008a2ebcd677 which only removed skeleton.dtsi usage for OMAP3 boards. The same can be done for other SoCs in its top level dtsi for the SoC family of course.

Yeah probaby best to add the empty chosen node to the ones that had skeleton.dtsi removed.

And I think the code should print a warning if no chosen node is found?

Regards,

Tony

#18 lore raw
Quoted 17 lines · On Friday 16 December 2016 16:40:30 Tony Lindgren wrote:
Quoted 16 lines · Javier Martinez Canillas
Quoted 14 lines · Pali Roh?r
Quoted 11 lines
Quoted 4 lines

saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Quoted 6 lines
Quoted 3 lines

Yes, but you were talking about commit 008a2ebcd677 which only removed skeleton.dtsi usage for OMAP3 boards. The same can be done for other SoCs in its top level dtsi for the SoC family of course.

Yeah probaby best to add the empty chosen node to the ones that had skeleton.dtsi removed.

Ok. But still I think that it should be added globally to all arm board which can be booted by ATAG bootloader.

Quoted 2 lines

And I think the code should print a warning if no chosen node is found?

Which code? Decompressor? Yes, it should but I do not know if at that time is (serial) console usable...

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161216/997b8f16/attachment-0001.sig>
#19 lore raw
Quoted 22 lines · Pali Roh?r
Quoted 21 lines · On Friday 16 December 2016 16:40:30 Tony Lindgren wrote:
Quoted 19 lines · Javier Martinez Canillas
Quoted 12 lines · Pali Roh?r
Quoted 11 lines
Quoted 4 lines

saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Quoted 2 lines

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Yes, but you were talking about commit 008a2ebcd677 which only removed skeleton.dtsi usage for OMAP3 boards. The same can be done for other SoCs in its top level dtsi for the SoC family of course.

Quoted 5 lines
Quoted 2 lines

Yeah probaby best to add the empty chosen node to the ones that had skeleton.dtsi removed.

Ok. But still I think that it should be added globally to all arm board which can be booted by ATAG bootloader.

Hmm you mean by the decompressor?

Quoted 5 lines
Quoted 2 lines

And I think the code should print a warning if no chosen node is found?

Which code? Decompressor? Yes, it should but I do not know if at that time is (serial) console usable...

Oh right, never mind..

Tony

#20 lore raw
In reply to Pali Rohár
Quoted 22 lines · Pali Roh?r
Quoted 21 lines · On Friday 16 December 2016 16:40:30 Tony Lindgren wrote:
Quoted 19 lines · Javier Martinez Canillas
Quoted 12 lines · Pali Roh?r
Quoted 11 lines
Quoted 4 lines

saying that it cause problems which need to be properly fixed. And if fixing them is harder and will take more time, then correct option is to revert 008a2ebcd677 due to breaking support for more devices.

If you think that others boards may have the same issue, then you could add an empty chosen node to omap3.dtsi. As I said I think that in practice this will only be needed for the machines using NOLO but you are right that in theory you could boot them using other bootloaders and having an empty node doesn't cause any harm anyway.

Quoted 2 lines

Should not be it part of any arm board? IIRC ATAG support is (or was) not omap3 specified.

Yes, but you were talking about commit 008a2ebcd677 which only removed skeleton.dtsi usage for OMAP3 boards. The same can be done for other SoCs in its top level dtsi for the SoC family of course.

Quoted 5 lines
Quoted 2 lines

Yeah probaby best to add the empty chosen node to the ones that had skeleton.dtsi removed.

Ok. But still I think that it should be added globally to all arm board which can be booted by ATAG bootloader.

+1

Quoted 5 lines
Quoted 2 lines

And I think the code should print a warning if no chosen node is found?

Which code? Decompressor? Yes, it should but I do not know if at that time is (serial) console usable...

It isn't in multiplatform situations. Best if the kernel prints it, because then it can be logged.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
#21 lore raw
In reply to Tony Lindgren
Quoted 2 lines · Tony Lindgren

Yeah probaby best to add the empty chosen node to the ones that had skeleton.dtsi removed.

Yes please!

We should probably update the comment in skeleton.dtsi to be more explicit. I had intended it to mean that chosen should always be present in the dts, but I worded it poorly.

Thanks,
Mark.

#9 lore raw
In reply to Pali Rohár
Quoted 73 lines · On Friday 16 December 2016 12:42:34 Pali Roh?r wrote:
Quoted 72 lines · On Thursday 15 December 2016 11:09:32 Russell King - ARM Linux wrote:
Quoted 1 line

What is reason that CONFIG_CMDLINE is not supported for DT?

Sorry, that's my mistake - as you've pointed out above, it is supported but via generic code. I was only looking at arch code when I made the statement.

This patch (untested) should solve it:

 drivers/of/fdt.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/of/fdt.c +0 -20
index c89d5d231a0e..fb89157332c6 100644
@@ -1073,26 +1073,6 @@ int __init
 early_init_dt_scan_chosen(unsigned long node, const char *uname,
 if (p != NULL && l > 0)
 
 		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
 
-	/*
-	 * CONFIG_CMDLINE is meant to be a default in case nothing else
-	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
-	 * is set in which case we override whatever was found earlier.
-	 */
-#ifdef CONFIG_CMDLINE
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(data, " ", COMMAND_LINE_SIZE);
-	strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
-	strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#else
-	/* No arguments from boot loader, use kernel's  cmdl*/
-	if (!((char *)data)[0])
-		strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#endif
-#endif /* CONFIG_CMDLINE */
-
-	pr_debug("Command line is: %s\n", (char*)data);
-
 
drivers/of/fdt.c +20 -0
 	/* break now */
 	return 1;
 
 }
@@ -1205,6 +1185,26 @@ void __init early_init_dt_scan_nodes(void)
 
 	/* Retrieve various information from the /chosen node */
 	of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
 
+	/*
+	 * CONFIG_CMDLINE is meant to be a default in case nothing else
+	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
+	 * is set in which case we override whatever was found earlier.
+	 */
+#ifdef CONFIG_CMDLINE
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#elif defined(CONFIG_CMDLINE_FORCE)
+	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#else
+	/* No arguments from boot loader, use kernel's cmdline */
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+#endif /* CONFIG_CMDLINE */
+
+	pr_debug("Command line is: %s\n", boot_command_line);
+
 
Quoted 4 lines
Quoted 2 lines
drivers/of/fdt.c +0 -0
 	/* Initialize {size,address}-cells info */

of_scan_flat_dt(early_init_dt_scan_root, NULL);

Patch is working fine and fixes my problem. You can add my Tested-by.

Russell, are you going to use your patch? Or original my? Or any other? If you need more testing or other data, let me know.

I would like to see this problem (non working CONFIG_CMDLINE) fixed...

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161225/1962bb36/attachment.sig>
#10 lore raw
Quoted 79 lines · Pali Roh?r
Quoted 73 lines · On Friday 16 December 2016 12:42:34 Pali Roh?r wrote:
Quoted 72 lines · On Thursday 15 December 2016 11:09:32 Russell King - ARM Linux wrote:
Quoted 1 line

What is reason that CONFIG_CMDLINE is not supported for DT?

Sorry, that's my mistake - as you've pointed out above, it is supported but via generic code. I was only looking at arch code when I made the statement.

This patch (untested) should solve it:

 drivers/of/fdt.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/of/fdt.c +0 -20
index c89d5d231a0e..fb89157332c6 100644
@@ -1073,26 +1073,6 @@ int __init
 early_init_dt_scan_chosen(unsigned long node, const char *uname,
 if (p != NULL && l > 0)
 
 		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
 
-	/*
-	 * CONFIG_CMDLINE is meant to be a default in case nothing else
-	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
-	 * is set in which case we override whatever was found earlier.
-	 */
-#ifdef CONFIG_CMDLINE
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(data, " ", COMMAND_LINE_SIZE);
-	strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
-	strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#else
-	/* No arguments from boot loader, use kernel's  cmdl*/
-	if (!((char *)data)[0])
-		strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#endif
-#endif /* CONFIG_CMDLINE */
-
-	pr_debug("Command line is: %s\n", (char*)data);
-
 
drivers/of/fdt.c +20 -0
 	/* break now */
 	return 1;
 
 }
@@ -1205,6 +1185,26 @@ void __init early_init_dt_scan_nodes(void)
 
 	/* Retrieve various information from the /chosen node */
 	of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
 
+	/*
+	 * CONFIG_CMDLINE is meant to be a default in case nothing else
+	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE
+	 * is set in which case we override whatever was found earlier.
+	 */
+#ifdef CONFIG_CMDLINE
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#elif defined(CONFIG_CMDLINE_FORCE)
+	strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#else
+	/* No arguments from boot loader, use kernel's cmdline */
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+#endif /* CONFIG_CMDLINE */
+
+	pr_debug("Command line is: %s\n", boot_command_line);
+
 
Quoted 4 lines
Quoted 2 lines
drivers/of/fdt.c +0 -0
 	/* Initialize {size,address}-cells info */

of_scan_flat_dt(early_init_dt_scan_root, NULL);

Patch is working fine and fixes my problem. You can add my Tested-by.

Quoted 4 lines

Russell, are you going to use your patch? Or original my? Or any other? If you need more testing or other data, let me know.

I would like to see this problem (non working CONFIG_CMDLINE) fixed...

If the DT people would like to comment on it and give me an ack or take the patch... I guess that's not going to happen as they're not on the Cc... I'll resend later today.

Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.