From patchwork Wed May 4 16:43:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 569869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EB49C433EF for ; Wed, 4 May 2022 16:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353838AbiEDRAn (ORCPT ); Wed, 4 May 2022 13:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354584AbiEDQ6x (ORCPT ); Wed, 4 May 2022 12:58:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D1C719039; Wed, 4 May 2022 09:50:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E9415B82554; Wed, 4 May 2022 16:50:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 832A6C385A5; Wed, 4 May 2022 16:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683035; bh=LN4KYRcCDF5ZUy/Iuw4eM2izh6Ti+dL1/kE1TDFqV5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CPssmFekfXRnQh/xKM8gfvcgvb4yKFHMmFSXwDu82unoVg7xfm60PO7+8fv8gs+dz fbhnrerRSIbH2ezMmPtkUuBiFfnt4SV7rZh01GWM40a93jfzVR0WC04KtuBADX3ysR 0/chu7uqLyTTsQhbNVy1HEn8x3iZfXdZH1qNBNM4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudeep Holla , Wang Qing Subject: [PATCH 5.10 031/129] arch_topology: Do not set llc_sibling if llc_id is invalid Date: Wed, 4 May 2022 18:43:43 +0200 Message-Id: <20220504153023.778112812@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang Qing commit 1dc9f1a66e1718479e1c4f95514e1750602a3cb9 upstream. When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which will set llc_sibling 0xff(...), this is misleading. Don't set llc_sibling(default 0) if we don't know the cache topology. Reviewed-by: Sudeep Holla Signed-off-by: Wang Qing Fixes: 37c3ec2d810f ("arm64: topology: divorce MC scheduling domain from core_siblings") Cc: stable Link: https://lore.kernel.org/r/1649644580-54626-1-git-send-email-wangqing@vivo.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/arch_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -515,7 +515,7 @@ void update_siblings_masks(unsigned int for_each_online_cpu(cpu) { cpu_topo = &cpu_topology[cpu]; - if (cpuid_topo->llc_id == cpu_topo->llc_id) { + if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); }