Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5518803ioo; Wed, 1 Jun 2022 07:12:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0i5fI47nmCXPXl1TDMA1OsCkBbMpjZzEqn0SKwut7w37BV0SFywKn4lItGt3uH/31XEAE X-Received: by 2002:a17:90b:4b05:b0:1e4:2964:b261 with SMTP id lx5-20020a17090b4b0500b001e42964b261mr5066456pjb.205.1654092754550; Wed, 01 Jun 2022 07:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654092754; cv=none; d=google.com; s=arc-20160816; b=vBPz0KHpUPtldWuR1kJDOpirUJbtnkKg/GKsA4G1pxNrJ6IIhp1H2fJ06TaYhMs91z QUga5dyZYoYi2qMCi2Nw/Buwb/X5eKFwFcV2sTDiezmRLxRyQXQ5egjDrlZ95W2BjvU7 NwrEbYxbQK7nFSNW8c9t/W5FdG2W+BTi+hQRXf5TNy+SdGsfAM0WktUL908hYsjfGsMC Ama0XTVBLeF91rqI9LBmFGHZnH9Jf9O/p0zx5qw2mp+FAq1L89J6KtPK5rLsJZjirsvx VDeFDkjHd0cDnsgQO3JEgjbPpWA15lmyyAhmT+u45C5+HYI4zSSEfm/0z0hOm2M5Ry/V j/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=g/QwG2vgWhruUHVSTvB1NROdcFoX8UsFct3vWYpMtXc=; b=cPOE+aX+PcrHqUPpM5OQ6yMBDo0oNZLZaWUCHsHk3G46j2URkJal3x6KgsaaA2+cg7 /6vhTDO3YtFILI4qO0cCp3NB5DagX8bGKorfLaDb7A4RWRj3xEW9Sj/gF2u1xfLj+pWC f70RBpdVC7mGVk8gznUrtbtI1L71/hAAD7ExzKv6NTw+uoyEB4HqMgrOjNvee5T4lmFi rvIgOY8q5mPcmQl0thezE0esmvbdj3tTBSyj/v8RIl+2tsTjP33E8k8Juk3tHxc5ZTZI 1VZtXHiZl1e70h8Q2cBudHAEe+mN4A5DShl1+884ThCHv9WUcBQbEfB+fGvImrirl0da BM3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dXnkLHQR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b003fa936eedd8si2340084pgd.481.2022.06.01.07.12.21; Wed, 01 Jun 2022 07:12:34 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dXnkLHQR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349388AbiFADa3 (ORCPT + 99 others); Tue, 31 May 2022 23:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349413AbiFADaE (ORCPT ); Tue, 31 May 2022 23:30:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F0B9D6B0A9 for ; Tue, 31 May 2022 20:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654054201; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g/QwG2vgWhruUHVSTvB1NROdcFoX8UsFct3vWYpMtXc=; b=dXnkLHQRh0c/hxeCfkKJU3Mt6+EgO79eebVKv6CXMObdLXRkS231qAjj39+f8wdGx1J0/o BesP/BWjd2c4fuYFYTcHpvnY8vtCInHkse9+Keegw9AQR9EVvki6WErFbmc2UNV3dwsHow lEvjOHS5M2GeHUaWcvbRpfsATSWb7Eo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-252-_0wYGXsEMgO2MBWxFVFRVw-1; Tue, 31 May 2022 23:29:57 -0400 X-MC-Unique: _0wYGXsEMgO2MBWxFVFRVw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A55C101A54E; Wed, 1 Jun 2022 03:29:56 +0000 (UTC) Received: from [10.72.12.91] (ovpn-12-91.pek2.redhat.com [10.72.12.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 680822166B26; Wed, 1 Jun 2022 03:29:50 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v3 06/16] arch_topology: Add support to parse and detect cache attributes To: Sudeep Holla , linux-kernel@vger.kernel.org Cc: 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 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> <20220525081416.3306043-7-sudeep.holla@arm.com> From: Gavin Shan Message-ID: Date: Wed, 1 Jun 2022 11:29:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20220525081416.3306043-7-sudeep.holla@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 Hi Sudeep, On 5/25/22 4:14 PM, Sudeep Holla wrote: > 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(-) > With below nits fixed: Reviewed-by: Gavin Shan > 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 > # ./scripts/checkpatch.pl --codespell patch/check/0006* ERROR: space required before the open parenthesis '(' #55: FILE: drivers/base/arch_topology.c:786: + if(ret) { Thanks, Gavin