From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18A0518C933 for ; Tue, 2 Dec 2025 02:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764641850; cv=none; b=TY87JjdGvRmjXVdt/VHrUvXkpyfd+fiHds5tPfJP5/C1kc9pWEDxmVqKkr6AeYv1mh6ogYQHnB6L089My1x7RTxiw1dI5AiykKhiBtgbU0PkDJMPuMnXI2zF+yRMijScuNNMxIE3SAqmeinrrgRLWSWyMoy7gKTXurhsd/0eD3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764641850; c=relaxed/simple; bh=1ZRi5xX9VbtphPsjHGKlPXHF8aQS8iZrkISvrjIFBKU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=krM75yn5HJdEw1KA+szOk3CPQPFYjzyN0iomgJ0jzMlttSd6XKz0fC3eDjm+5+GuH/26qmSrkA1A21QmvXQgD+OI/ANCMUCOaeUGaloGJiscvElKbnATfCY4sDDqXOdhuIR6jSeDwFfXf3JFExu/GggaxaQ8t19gAbWx94ikWaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Ye8rYZub; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ye8rYZub" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1764641835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QDmQY+UGZrTPdlfQJsHoJi3IV6xhnWKEOKkFlDanYis=; b=Ye8rYZub5prrTJAafuWLuXDTM7nk/1yHeQUI/vVTaW+HBWm59ri6lthwbUSuSMtSDdycZC /nGnyH7z2OmD1N6UEc5/ny5iQ5MzI1GeTEErPKTApBXUc/rCiupolTTGR/NTp4ndP3WYYb zm9aA7ITn3DmfMDRZ0T44x503yU+DeQ= Date: Tue, 2 Dec 2025 10:17:03 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] of: print warning when cmdline overflows from bootargs To: Krzysztof Kozlowski Cc: robh@kernel.org, saravanak@google.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, enlin.mu@unisoc.com References: <20251105082717.4040-1-enlin.mu@linux.dev> <20251106-kiwi-of-total-valor-b27f5d@kuoka> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "enlin.mu" In-Reply-To: <20251106-kiwi-of-total-valor-b27f5d@kuoka> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT 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 >> >> 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 >> --- >> 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 >