devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: print warning when cmdline overflows from bootargs
@ 2025-11-05  8:27 Enlin Mu
  2025-11-06  8:55 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Enlin Mu @ 2025-11-05  8:27 UTC (permalink / raw)
  To: robh, saravanak, devicetree, linux-kernel, enlin.mu, enlin.mu

From: Enlin Mu <enlin.mu@uisoc.com>

add debug info. sometimes cmdline in dts is too long,
developers are not aware of the length limit of the
cmdline, resulting in some misjudgments.

Signed-off-by: Enlin Mu <enlin.mu@uisoc.com>
---
 drivers/of/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 0edd639898a6..077799b2f565 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1085,6 +1085,8 @@ int __init early_init_dt_scan_chosen(char *cmdline)
 	p = of_get_flat_dt_prop(node, "bootargs", &l);
 	if (p != NULL && l > 0)
 		strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE));
+	if (l > COMMAND_LINE_SIZE)
+		pr_warn("cmdline overflows from bootargs\n");
 
 handle_cmdline:
 	/*
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: print warning when cmdline overflows from bootargs
  2025-11-05  8:27 [PATCH] of: print warning when cmdline overflows from bootargs Enlin Mu
@ 2025-11-06  8:55 ` Krzysztof Kozlowski
  2025-11-06  9:17   ` Conor Dooley
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-06  8:55 UTC (permalink / raw)
  To: Enlin Mu; +Cc: robh, saravanak, devicetree, linux-kernel, enlin.mu

On Wed, Nov 05, 2025 at 04:27:17PM +0800, Enlin Mu wrote:
> From: Enlin Mu <enlin.mu@uisoc.com>
> 
> add debug info. sometimes cmdline in dts is too long,

I don't see debug info here.

Please use full sentences, starting with capital letter and ending with
full stop.

Please wrap commit message according to Linux coding style / submission
process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597


> developers are not aware of the length limit of the
> cmdline, resulting in some misjudgments.
> 
> Signed-off-by: Enlin Mu <enlin.mu@uisoc.com>
> ---
>  drivers/of/fdt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 0edd639898a6..077799b2f565 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1085,6 +1085,8 @@ int __init early_init_dt_scan_chosen(char *cmdline)
>  	p = of_get_flat_dt_prop(node, "bootargs", &l);
>  	if (p != NULL && l > 0)
>  		strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE));
> +	if (l > COMMAND_LINE_SIZE)
> +		pr_warn("cmdline overflows from bootargs\n");

Why only OF early should have this warning and cmdline passed via ATAGS
or in ACPI system should not?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: print warning when cmdline overflows from bootargs
  2025-11-06  8:55 ` Krzysztof Kozlowski
@ 2025-11-06  9:17   ` Conor Dooley
  0 siblings, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2025-11-06  9:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Enlin Mu, robh, saravanak, devicetree, linux-kernel, enlin.mu

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

On Thu, Nov 06, 2025 at 09:55:17AM +0100, Krzysztof Kozlowski wrote:
> On Wed, Nov 05, 2025 at 04:27:17PM +0800, Enlin Mu wrote:
> > From: Enlin Mu <enlin.mu@uisoc.com>
> > 
> > add debug info. sometimes cmdline in dts is too long,
> 
> I don't see debug info here.
> 
> Please use full sentences, starting with capital letter and ending with
> full stop.
> 
> Please wrap commit message according to Linux coding style / submission
> process (neither too early nor over the limit):
> https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597
> 
> 
> > developers are not aware of the length limit of the
> > cmdline, resulting in some misjudgments.
> > 
> > Signed-off-by: Enlin Mu <enlin.mu@uisoc.com>

Also, the email address here is wrong, there's previous submissions from
Enlin Mu <enlin.mu@unisoc.com> which I expect is the same person...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-06  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05  8:27 [PATCH] of: print warning when cmdline overflows from bootargs Enlin Mu
2025-11-06  8:55 ` Krzysztof Kozlowski
2025-11-06  9:17   ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).