lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aRyoLBjD_8Hz91DV@pie>
Date: Tue, 18 Nov 2025 17:09:00 +0000
From: Yao Zi <ziyao@...root.org>
To: Huacai Chen <chenhuacai@...ngson.cn>,
	Arnd Bergmann <arnd@...db.de>, Huacai Chen <chenhuacai@...nel.org>,
	Huacai Chen <chenhuacai@...nel.org>, f@...root.org
Cc: loongarch@...ts.linux.dev, linux-arch@...r.kernel.org,
	Xuefeng Li <lixuefeng@...ngson.cn>, Guo Ren <guoren@...nel.org>,
	Xuerui Wang <kernel@...0n.name>,
	Jiaxun Yang <jiaxun.yang@...goat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 04/14] LoongArch: Adjust boot & setup for 32BIT/64BIT

On Tue, Nov 18, 2025 at 07:27:18PM +0800, Huacai Chen wrote:
> Adjust boot & setup for both 32BIT and 64BIT, including: efi header
> definition, MAX_IO_PICS definition, kernel entry and environment setup
> routines, etc.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
> ---
>  arch/loongarch/include/asm/addrspace.h |  2 +-
>  arch/loongarch/include/asm/irq.h       |  5 ++++
>  arch/loongarch/kernel/efi-header.S     |  4 +++
>  arch/loongarch/kernel/efi.c            |  4 ++-
>  arch/loongarch/kernel/env.c            |  9 ++++--
>  arch/loongarch/kernel/head.S           | 39 +++++++++++---------------
>  arch/loongarch/kernel/relocate.c       |  9 +++++-
>  7 files changed, 45 insertions(+), 27 deletions(-)
> 

...

> diff --git a/arch/loongarch/kernel/env.c b/arch/loongarch/kernel/env.c
> index 23bd5ae2212c..3e8a25eb901b 100644
> --- a/arch/loongarch/kernel/env.c
> +++ b/arch/loongarch/kernel/env.c
> @@ -68,18 +68,23 @@ static int __init fdt_cpu_clk_init(void)
>  
>  	np = of_get_cpu_node(0, NULL);
>  	if (!np)
> -		return -ENODEV;
> +		goto fallback;
>  
>  	clk = of_clk_get(np, 0);
>  	of_node_put(np);
>  
>  	if (IS_ERR(clk))
> -		return -ENODEV;
> +		goto fallback;
>  
>  	cpu_clock_freq = clk_get_rate(clk);
>  	clk_put(clk);
>  
>  	return 0;
> +
> +fallback:
> +	cpu_clock_freq = 200 * 1000 * 1000;

Why pick 200MHz here? And shouldn't the clock being always provided in
devicetree if it's necessary for kernel to function?

Per the schema for LoongArch CPUs (loongarch/cpus.yaml), "clocks"
property is also described as mandantory, thus I don't think such
fallback makes sense.

> +
> +	return -ENODEV;
>  }
>  late_initcall(fdt_cpu_clk_init);

Best regards,
Yao Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ