Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2093923ybb; Sat, 11 Apr 2020 20:28:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIJ2HE+nlYlP/whqpTwtEjQ0odQgoz1sZ02TCki4g+4nx5kwF6HSasqxd1cVQwuPn/a1hN2 X-Received: by 2002:ac8:720f:: with SMTP id a15mr5785918qtp.207.1586662095257; Sat, 11 Apr 2020 20:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586662095; cv=none; d=google.com; s=arc-20160816; b=TtV5VJsQZjW+zO6wF3VnI3Y2Rwn00TLb6Wt+/jlU2v0YEq6EFYyrU/RUSlItrt3Mvt 3leNDjcGEBOxZviDm1vp3wnTBGkNmfLZE/dO8FchIEd3DH/5YXBg5vploA5GlyHlYvXe AOkGzwhdMYzi9MN+iSYLJL9WWy3rLPv9EZ+GG+GSA4fEgGGustKcoimN4LgsOhrwpeoN VIYnR9hguNSni5GXBXfKlRX8HRU1AKg2pWBhyxpsrqEu8lNaa4NB7pZhkGmU9wC8Z2kD C9SryuFV8YyaMSVhBgPp2mHMZyLJo7PyQ9LewQ+ul0rvIsTE+PbyKhTLeRq1+FaU2iMC aGMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6KL7EqAky6KCFz8aPFZrs/VtpBEPBlLCUJw3UTojUZw=; b=AwsSBnKbb/5qy7pd+I1t9eSr/D8mIjGWpa02catnGFBwHizwohUK/OXlzeWwLs1EaF Gw/7I7CzoXP4HH4PRn3bIc2AAub+9mC6eeDjPe/BLCnHuTdZ+UO65/QfabUKRUFn6hAq 2lOKP06N9O6KvDO8HsYhM6Q4D3+NwFsqP2ltoYerlrRyzvOwVXp+jME648KcIUap0UFZ cebJr7LscBfycJ+644qrgLonZ9Jal/66OGRE5jQ6vJ7RSr6WtDTd+PaeqMeDOpqjdl6y l/Yy7lQ8B8Mh3qHRS3fwNQc2xTpwqNC/N+wFeqOjo6c9l12pbxchv6Xb590WF976uIiJ LjtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b="xGx/6YE0"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y185si3772734qka.96.2020.04.11.20.28.01; Sat, 11 Apr 2020 20:28:15 -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; dkim=fail header.i=@flygoat.com header.s=vultr header.b="xGx/6YE0"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726942AbgDLD0N (ORCPT + 99 others); Sat, 11 Apr 2020 23:26:13 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:54722 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgDLD0N (ORCPT ); Sat, 11 Apr 2020 23:26:13 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 67F8320D16; Sun, 12 Apr 2020 03:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1586661973; bh=tGxZsojCaXRQzUdr7zPR3NOXIGurTKod1uy8NjI5p4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xGx/6YE0io5bsdUPMhxoxEtHAD2PhTqgr8oGauD28ht0om5LPEo9Gg+mYvohWevhA DDt7PXbYLaEmUppcrL7V3FD5fsup9agG6l9dlf3MM/mfoiQ/qm7RY+JV/YiKSVbTX7 t5dyba1nNAHbzbaddtE0RtBYGhPPEVgAu64dbSmm7RNhD5GvXAsUjkZS2P3k+NFHgN OXiiUhR58SGALxKtK3jd+Tn4s0v3SdRdz6uPrMisS7WmGYiFYnuWVS8wpT5xo5jUVa lPrY8npH96DYo0qUsW0z9OI4ly38crST4a56ezVKQ73/EKeXcGDHFj7RR0F5YCksH+ t7Zh+NbVX1AWw== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: dietmar.eggemann@arm.com, Jiaxun Yang , 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" , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Marc Zyngier , Paul Burton , Allison Randal , Enrico Weigelt , Kate Stewart , Vladimir Kondratiev , Alexios Zavras , Paul Cercueil , Zhou Yanjie , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0=20=28Zhou=20Yanjie=29?= , YunQiang Su , Arnd Bergmann , Serge Semin , Matt Redfearn , Richard Fontana , Steve Winslow , afzal mohammed , Peter Xu , Kamal Dasu , Oleksij Rempel , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, oprofile-list@lists.sf.net, linux-pm@vger.kernel.org Subject: [PATCH v2 04/11] arch_topology: Reset all cpus in reset_cpu_topology Date: Sun, 12 Apr 2020 11:20:34 +0800 Message-Id: <20200412032123.3896114-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200412032123.3896114-1-jiaxun.yang@flygoat.com> References: <20200412032123.3896114-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- v2: Use ARRAY_SIZE instead of NR_CPUS. --- 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 13dc4fbf043f..e7912d0a875e 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -536,7 +536,7 @@ void __init reset_cpu_topology(void) { unsigned int cpu; - for_each_possible_cpu(cpu) { + for (cpu = 0; cpu < ARRAY_SIZE(cpu_topology); cpu++) { struct cpu_topology *cpu_topo = &cpu_topology[cpu]; cpu_topo->thread_id = -1; -- 2.26.0.rc2