lkml.org 
[lkml]   [2020]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 04/12] arch_topology: Reset all cpus in reset_cpu_topology
Date

On 08/04/20 12:34, Jiaxun Yang wrote:
> For MIPS platform, when topology isn't probed by DeviceTree,
> possible_cpu might be empty when calling init_cpu_topology,
> that may result cpu_topology not fully reseted for all CPUs.
> So here we can reset all cpus instead of possible cpus.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> drivers/base/arch_topology.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
> index 9c2405d08dae..3398b7ac7dfb 100644
> --- a/drivers/base/arch_topology.c
> +++ b/drivers/base/arch_topology.c
> @@ -542,7 +542,7 @@ void __init reset_cpu_topology(void)
> {
> unsigned int cpu;
>
> - for_each_possible_cpu(cpu) {
> + for (cpu = 0; cpu < NR_CPUS; cpu++) {

Hmph, kind of a shame but if you really have to do it then perhaps you
should go with ARRAY_SIZE(cpu_topology) instead.

> struct cpu_topology *cpu_topo = &cpu_topology[cpu];
>
> cpu_topo->thread_id = -1;

\
 
 \ /
  Last update: 2020-04-08 20:24    [W:0.139 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site