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: <20250718121238.00005121@huawei.com>
Date: Fri, 18 Jul 2025 12:12:38 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Alireza Sanaee <alireza.sanaee@...wei.com>
CC: <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<coresight@...ts.linaro.org>, <dianders@...omium.org>,
	<james.clark@...aro.org>, <krzk@...nel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-perf-users@...r.kernel.org>,
	<linuxarm@...wei.com>, <mark.rutland@....com>, <mike.leach@...aro.org>,
	<robh@...nel.org>, <ruanjinjie@...wei.com>, <saravanak@...gle.com>,
	<shameerali.kolothum.thodi@...wei.com>, <suzuki.poulose@....com>
Subject: Re: [PATCH v3 2/6] arch_topology: drop the use of cpu_node in the
 pr_info

On Fri, 18 Jul 2025 10:48:44 +0100
Alireza Sanaee <alireza.sanaee@...wei.com> wrote:

> Remove the use of cpu_node in the pr_info. When of_cpu_node_to_id fails,
> it may set a pointer, cpu_node, and the get_cpu_for_node function uses that
> pointer to log further in the fail scenario.
> 
> Also, change the structure to exit early in fail scenarios which will
> help enabling code unification that follows in this series.

So this patch is the trade off to the unification.   Some small
amount of info in the info message is lost.  To me that looks
fine, but others may disagree!

I assume the motivation for not just leaving this one alone is
we ultimately need the flexible handler for the SMT series?

> 
> Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>

Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>

> ---
>  drivers/base/arch_topology.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 1037169abb45..6fafd86f608a 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -481,12 +481,13 @@ static int __init get_cpu_for_node(struct device_node *node)
>  		return -1;
>  
>  	cpu = of_cpu_node_to_id(cpu_node);
> -	if (cpu >= 0)
> -		topology_parse_cpu_capacity(cpu_node, cpu);
> -	else
> -		pr_info("CPU node for %pOF exist but the possible cpu range is :%*pbl\n",
> -			cpu_node, cpumask_pr_args(cpu_possible_mask));
> +	if (cpu < 0) {
> +		pr_info("CPU node exist but the possible cpu range is :%*pbl\n",
> +			cpumask_pr_args(cpu_possible_mask));
> +		return cpu;
> +	}
>  
> +	topology_parse_cpu_capacity(cpu_node, cpu);
>  	return cpu;
>  }
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ