Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3884843ioo; Wed, 25 May 2022 09:59:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNWCDVkTy/wKLrM7y+zdLKtbG/6baIp5GbCk7ByVBqLqyptPrgbVu9LD7zxAG9I7qqT5Ki X-Received: by 2002:a17:902:6b83:b0:15d:1ea2:4f80 with SMTP id p3-20020a1709026b8300b0015d1ea24f80mr32956913plk.41.1653497957381; Wed, 25 May 2022 09:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653497957; cv=none; d=google.com; s=arc-20160816; b=fubBlQwRglN+cSlIDrVE/Gx1ovMz3fmo+atZrIzPi9MLzftyZz14nDZAbqxAC7TMf9 3zqwdllYYHYw43jIOKb2q5AbIzayehrhuvZww3anEbLuXItZaDhy1DkW8qRq+S4slxJO BKBofO1G8ilnWd7p+3zIFbQ+tGcNC/iyeN/P7RD+W9O9NkewPQ9iDabhf1F3k0kXNBSu GWt2bmx9iqwUpfyYgHaOYtNL2DXK+dODlw5E3Y1z6P+U2VOSiXVEjZLOR1NMgahJIKfb XZNLCNP6LEHP/tu4yRklEH5sEKGlKSGodX4buseE4l+XbNXPb2ZPyyr2ICEL+AyADddM 1zcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CVGpqRwMUrGoXSoEgDpr10NM/tx1PVmufvhndwIrPF0=; b=T1rMEoQjTst2gC+68ZcoqcNwhhEz7hCgk44eXmwJoNxjf2CgZRrpCFwWbjdaevXO5G mIllALAw8mY7ZBcb36ffL/L8oPV6Jhh5OkLVQK2aSsogvmtlJ+7OAz8B9P1UVAQr3oT8 Gv14mSYx1SM3oUUq53x3LR9MlxtZ7iV4kid59HjdfkiYj/a0hEydah1YD5QazV8N4zfb tLyZ87S+5R6/0loSxznkLdXgIifHPZWGQK9yqVm8EQalFfWooayt1eqRslREG5aGbCYI NC+JRw6jSRqFRp8rDIiEfhTGFVlYiGBw1+1o2fidYqBtXXDCd/55dv2s0ZgUGhjJhUG0 jSIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a634542000000b003faa259a522si6928891pgk.288.2022.05.25.09.59.05; Wed, 25 May 2022 09:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbiEYIPQ (ORCPT + 99 others); Wed, 25 May 2022 04:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236816AbiEYIOq (ORCPT ); Wed, 25 May 2022 04:14:46 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 99F5D84A19 for ; Wed, 25 May 2022 01:14:45 -0700 (PDT) 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 EEE0023A; Wed, 25 May 2022 01:14:44 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 075813F73D; Wed, 25 May 2022 01:14:42 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Atish Patra , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring Subject: [PATCH v3 06/16] arch_topology: Add support to parse and detect cache attributes Date: Wed, 25 May 2022 09:14:06 +0100 Message-Id: <20220525081416.3306043-7-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525081416.3306043-6-sudeep.holla@arm.com> References: <20220525081416.3306043-1-sudeep.holla@arm.com> <20220525081416.3306043-2-sudeep.holla@arm.com> <20220525081416.3306043-3-sudeep.holla@arm.com> <20220525081416.3306043-4-sudeep.holla@arm.com> <20220525081416.3306043-5-sudeep.holla@arm.com> <20220525081416.3306043-6-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently ACPI populates just the minimum information about the last level cache from PPTT in order to feed the same to build sched_domains. Similar support for DT platforms is not present. In order to enable the same, the entire cache hierarchy information can be built as part of CPU topoplogy parsing both on ACPI and DT platforms. Note that this change builds the cacheinfo early even on ACPI systems, but the current mechanism of building llc_sibling mask remains unchanged. Signed-off-by: Sudeep Holla --- drivers/base/arch_topology.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index f73b836047cf..765723448b10 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -775,15 +776,23 @@ __weak int __init parse_acpi_topology(void) #if defined(CONFIG_ARM64) || defined(CONFIG_RISCV) void __init init_cpu_topology(void) { + int ret, cpu; + reset_cpu_topology(); + ret = parse_acpi_topology(); + if (!ret) + ret = of_have_populated_dt() && parse_dt_topology(); - /* - * Discard anything that was parsed if we hit an error so we - * don't use partial information. - */ - if (parse_acpi_topology()) - reset_cpu_topology(); - else if (of_have_populated_dt() && parse_dt_topology()) + if(ret) { + /* + * Discard anything that was parsed if we hit an error so we + * don't use partial information. + */ reset_cpu_topology(); + return; + } + + for_each_possible_cpu(cpu) + detect_cache_attributes(cpu); } #endif -- 2.36.1