From: "enlin.mu" <enlin.mu@linux.dev>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: robh@kernel.org, saravanak@google.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
enlin.mu@unisoc.com
Subject: Re: [PATCH] of: print warning when cmdline overflows from bootargs
Date: Tue, 2 Dec 2025 10:17:03 +0800 [thread overview]
Message-ID: <bc7281f5-bce6-407b-96e1-18293f373921@linux.dev> (raw)
In-Reply-To: <20251106-kiwi-of-total-valor-b27f5d@kuoka>
On 2025/11/6 16:55, 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>
>> ---
>> 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?
I have a Raspberry Pi 5, so I can test my patch. But for chips with
other architectures, I don't have the equipment and I am not very
familiar with them. If you are familiar with other architectures,
I hope you can help impore the patch or independently complete this
idea.
Thanks.
>
> Best regards,
> Krzysztof
>
prev parent reply other threads:[~2025-12-02 2:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2025-12-02 2:17 ` enlin.mu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc7281f5-bce6-407b-96e1-18293f373921@linux.dev \
--to=enlin.mu@linux.dev \
--cc=devicetree@vger.kernel.org \
--cc=enlin.mu@unisoc.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.