Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1024274ybb; Wed, 8 Apr 2020 14:54:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLyf9J+UXLFiF2fCtpwYx6rkclwYFUiYCh6a5+kVYLgKfOdAsXOR6EgfWgtPcj06HNaCuFC X-Received: by 2002:a9d:6354:: with SMTP id y20mr7448716otk.171.1586382874253; Wed, 08 Apr 2020 14:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586382874; cv=none; d=google.com; s=arc-20160816; b=ty6/6JxFf6CAA4WMiAAip4CV3ef+VYJ0jpJWgLnrZ+z5XRcsLjPfDTEgGGyW9TBQE0 1G5mwGOYLXqQyHIlJbbzqsr6H5C/q9+ZolL4xSj76vsq1wq4bhbq3NGRpk1KDdOQqGjo isAe/2wn7bVcu+wjW0NOWCAOVBFCsdSDTygaJGqEg3X2dwTOPZgSDvyGcrx2WZOLADiq T2rsVQjCkuxRfP0FtLxbhzYznUZtA/yg9m3ZYDph2Lmip2thjh+hb4Yadd4Co+d0tYT2 3fbH/lk05wK3PbeBMU8Vi9H9P+47zvHo/StI+wON9I4vowGUMT3Tf+MI0upbqPf81jqM Lq6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=toxzkSVLuXT9q+hwBPFzTsUvDYXBPNCwtaxdpbbVCBg=; b=QreexkAce/pPlBAPUmwqPNwZ/SiDAB5FcLDLEtokhliRTcTbcxUoLdBdXW3EJYKx9E WoGVTQhIO4DHW9GbOh9sZEQK86i6/RWe1dnEV+vWER6RXBojXpAlTG3GK5gim+Coa+Mo Me8n7kYhAdxlNk5bhjD+KDhjtj2Hu4eFWkf0WuLz3qH+IO65Xwu7M3dFVrHX3+PJtW0c LTKTnZxCwLdeTtc4AH7C8Yj0AjTiBAwfdrwU8/4ev8Nmf6MEhQ6TCvxfQK2rV+DTCAXh QFL7CcrichvQ9vx6kZY8LfO4wAObT/RVkjOKN12KdIwc5+PdRgHsthTe48bFmUrv3Sb9 HADg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si2527365oif.250.2020.04.08.14.54.21; Wed, 08 Apr 2020 14:54:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbgDHSXj (ORCPT + 99 others); Wed, 8 Apr 2020 14:23:39 -0400 Received: from foss.arm.com ([217.140.110.172]:42060 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730703AbgDHSXi (ORCPT ); Wed, 8 Apr 2020 14:23:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 753527FA; Wed, 8 Apr 2020 11:23:37 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC5403F73D; Wed, 8 Apr 2020 11:23:32 -0700 (PDT) References: <20200408113505.2528103-1-jiaxun.yang@flygoat.com> <20200408113505.2528103-5-jiaxun.yang@flygoat.com> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, Thomas Bogendoerfer , Huacai Chen , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Florian Fainelli , Robert Richter , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Thomas Gleixner , Jason Cooper , Marc Zyngier , Paul Burton , Allison Randal , Enrico Weigelt , Vladimir Kondratiev , Alexios Zavras , Richard Fontana , Paul Cercueil , Zhou Yanjie , =?utf-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= , YunQiang Su , Arnd Bergmann , Serge Semin , Matt Redfearn , Steve Winslow , Peter Xu , afzal mohammed , Mike Rapoport , Kamal Dasu , Oleksij Rempel , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, oprofile-list@lists.sf.net Subject: Re: [PATCH 04/12] arch_topology: Reset all cpus in reset_cpu_topology In-reply-to: <20200408113505.2528103-5-jiaxun.yang@flygoat.com> Date: Wed, 08 Apr 2020 19:23:30 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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;