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]
Date:   Tue, 17 Oct 2017 16:24:23 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Suzuki K Poulose <suzuki.poulose@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        robh@...nel.org, will.deacon@....com, sudeep.holla@....com,
        frowand.list@...il.com, devicetree@...r.kernel.org,
        Jonathan.Cameron@...wei.com, marc.zyngier@....com,
        peterz@...radead.org, mathieu.poirier@...aro.org,
        leo.yan@...aro.org, Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCH v8 5/8] arm64: Use of_cpu_node_to_id helper for CPU
 topology parsing

On Tue, Oct 10, 2017 at 11:33:00AM +0100, Suzuki K Poulose wrote:
> Make use of the new generic helper to convert an of_node of a CPU
> to the logical CPU id in parsing the topology.
> 
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Leo Yan <leo.yan@...aro.org>
> Cc: Will Deacon <will.deacon@....com>
> Cc: Mark Rutland <mark.rutland@....com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>

This looks sane to me, but it will need an ack from Will or Catalin.

FWIW:

Acked-by: Mark Rutland <mark.rutland@....com>

Thanks,
Mark.

> ---
>  arch/arm64/kernel/topology.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> index 8d48b233e6ce..21868530018e 100644
> --- a/arch/arm64/kernel/topology.c
> +++ b/arch/arm64/kernel/topology.c
> @@ -37,18 +37,14 @@ static int __init get_cpu_for_node(struct device_node *node)
>  	if (!cpu_node)
>  		return -1;
>  
> -	for_each_possible_cpu(cpu) {
> -		if (of_get_cpu_node(cpu, NULL) == cpu_node) {
> -			topology_parse_cpu_capacity(cpu_node, cpu);
> -			of_node_put(cpu_node);
> -			return cpu;
> -		}
> -	}
> -
> -	pr_crit("Unable to find CPU node for %pOF\n", cpu_node);
> +	cpu = of_cpu_node_to_id(cpu_node);
> +	if (cpu >= 0)
> +		topology_parse_cpu_capacity(cpu_node, cpu);
> +	else
> +		pr_crit("Unable to find CPU node for %pOF\n", cpu_node);
>  
>  	of_node_put(cpu_node);
> -	return -1;
> +	return cpu;
>  }
>  
>  static int __init parse_core(struct device_node *core, int cluster_id,
> -- 
> 2.13.6
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ