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] [thread-next>] [day] [month] [year] [list]
Message-ID: <affff6410e681152c3fdcf3512df76d734f29aeb.camel@xry111.site>
Date: Wed, 28 Aug 2024 19:59:04 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Huacai Chen <chenhuacai@...ngson.cn>, "Rafael J . Wysocki"
	 <rafael@...nel.org>, Viresh Kumar <viresh.kumar@...aro.org>, Huacai Chen
	 <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Xuerui Wang <kernel@...0n.name>, Jiaxun Yang
	 <jiaxun.yang@...goat.com>, Binbin Zhou <zhoubinbin@...ngson.cn>
Subject: Re: [PATCH] cpufreq: loongson3: Use raw_smp_processor_id() in
 do_service_request()

On Wed, 2024-08-28 at 14:24 +0800, Huacai Chen wrote:
> Use raw_smp_processor_id() instead of plain smp_processor_id() in
> do_service_request(), otherwise we may get some errors with the driver
> enabled:
> 
>  BUG: using smp_processor_id() in preemptible [00000000] code: (udev-
> worker)/208
>  caller is loongson3_cpufreq_probe+0x5c/0x250 [loongson3_cpufreq]
> 
> Reported-by: Xi Ruoyao <xry111@...111.site>
> Tested-by: Binbin Zhou <zhoubinbin@...ngson.cn>
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>

Tested-by: Xi Ruoyao <xry111@...111.site>

After this patch the BUG() message is gone, but I still get

[    6.610357] loongson3_cpufreq loongson3_cpufreq: probe with driver loongson3_cpufreq failed with error -1

-1 is EPERM and there are several "return -EPERM;" in the code.  Not
sure which one.

Do I need to modify some firmware setting to make it work?

FWIW I'm building it as a module.  Should I try building it as a part of
vmlinux?

> ---
>  drivers/cpufreq/loongson3_cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/loongson3_cpufreq.c
> b/drivers/cpufreq/loongson3_cpufreq.c
> index 5f79b6de127c..6b5e6798d9a2 100644
> --- a/drivers/cpufreq/loongson3_cpufreq.c
> +++ b/drivers/cpufreq/loongson3_cpufreq.c
> @@ -176,7 +176,7 @@ static DEFINE_PER_CPU(struct loongson3_freq_data
> *, freq_data);
>  static inline int do_service_request(u32 id, u32 info, u32 cmd, u32
> val, u32 extra)
>  {
>  	int retries;
> -	unsigned int cpu = smp_processor_id();
> +	unsigned int cpu = raw_smp_processor_id();
>  	unsigned int package = cpu_data[cpu].package;
>  	union smc_message msg, last;
>  

-- 
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ