Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp502034rdb; Thu, 18 Jan 2024 09:37:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6wPyVru+/lZxmcuUW8M1b/QPi2mYLkWPZbU4h8dTT9xHKoYV5ru621I0UZEYhzolMCGWK X-Received: by 2002:a17:906:c092:b0:a2c:fe9d:98bb with SMTP id f18-20020a170906c09200b00a2cfe9d98bbmr612560ejz.29.1705599447978; Thu, 18 Jan 2024 09:37:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705599447; cv=pass; d=google.com; s=arc-20160816; b=kQ9h3EJObufdb2UxdWvIZJVWgdGykmPc50p/5gnFEOdhOFoeEXQL4Iiru/kZmbSZJh SOzrJkYpLi8JFPX1Sl6SQAX2aAfSpXbDkCfuaRp18sqJq7IlzZ6962MXTUlZXPqHdJGc kWoqqGVJyg+KDTUi3Xu+ISa+2ubdmNtR9d8GGMYORYJfCbifO+TyUki9tzJweNSRTLlE ttD51ThYi2W1FFP8woO3n9pySYAVSZH1Zq0BQHacbbSo1sfLCWKZmBnYKZA/s8c/OupU P366Mqj//aokmn3F0lgIlwXjELzWq8AR6gHEFMZ250w2S6gbEBRD9f/Y9uEVARYqtEL/ RS6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=+qvI/CenR55XMt6Ao2SVX1cJNh+r8gk/zzV/mPrDlNA=; fh=940H6yqAPDqcRsDpw+YNR6TK6OKIamxLzOHpwWuV2d0=; b=Xv2wpf7YQdKFUQ8zRjqZ86wI4b036Jv8gFTKV18LGDuA78PybEvSNfr2KSpSNbOK/N BgTwNGvxei0UxHn6hORR5SZ/gsURUerVgD2Xp/bgs4y2uOkmZR/enXhAEVqaehL7qPkI XtaORqYWtYxS9CRMzh/lt5ugwqcaEqC58+8gCR6r5swqCvtClKdNjt8cZc9mnz1cVYKb D6vnYqr6kF6VUBCdqT73Et1aW7fq6kh/AEZRe84biFeS4tOsrWjsju1y8lVUyVeTo38i tf6X/DzL/+ysIco7ibe47q1MPwN55Z5YndLli63AnGiGL+AOHB3XcgEB9CczdxElclPm mJYQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-30428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30428-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j27-20020a170906255b00b00a2e07890612si3553547ejb.400.2024.01.18.09.37.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 09:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-30428-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30428-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 801211F26B8D for ; Thu, 18 Jan 2024 17:36:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19D0C2D620; Thu, 18 Jan 2024 17:36:29 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39C212D616 for ; Thu, 18 Jan 2024 17:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705599388; cv=none; b=Wa9h8wXna73cUAZbsi5uRPUDncalTsnuoZ/InVCniPpQQjaoz1ZahkekUouyixvY256pAfWuzfre95B2KJBLlED+owAqXlko7hbrAJJyC8vxsDqLaSvyi7M69oRPDJldx8pB1XiaKdnxfqiMXQpKLhVZ8e1W2hX64ju56ysIWU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705599388; c=relaxed/simple; bh=lm3pt7KdFYd/SORPvxfLYNRuDhB8ojSgjUEPfZzkQK8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:Content-Type; b=sgoKsj/3NXxR3MCWzl33VjAhZyxtg/xaOmt63FgU1R0uZKFAKWfYzWbmfmoCiVu0NI83Wi6QTNxPxsBwwjNw6vKJcs9h+XYEyOHmt/P0kmeAyvj8S2jJCiLU8ijBxEdT+5CYKdWSZpf8/bKes+5kc4Ksdaf7BV64gjWcAFTPpMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 DA9681042; Thu, 18 Jan 2024 09:37:10 -0800 (PST) Received: from [192.168.1.13] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 234A23F5A1; Thu, 18 Jan 2024 09:36:19 -0800 (PST) Message-ID: <82d272fb-ffc3-4d55-b92a-497cbc13fc03@arm.com> Date: Thu, 18 Jan 2024 18:36:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Resend PATCH] topology: Set capacity_freq_ref in all cases To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, linux-kernel@vger.kernel.org Cc: lukasz.luba@arm.com, ionela.voinescu@arm.com References: <20240117190545.596057-1-vincent.guittot@linaro.org> Content-Language: en-US From: Pierre Gondois In-Reply-To: <20240117190545.596057-1-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Tested-by: Pierre Gondois On 1/17/24 20:05, Vincent Guittot wrote: > If "capacity-dmips-mhz" is not set, raw_capacity is null and we skip the > normalization step which includes setting per_cpu capacity_freq_ref. > Always register the notifier but skip the capacity normalization if > raw_capacity is null. > > Fixes: 9942cb22ea45 ("sched/topology: Add a new arch_scale_freq_ref() method") > Signed-off-by: Vincent Guittot > --- > > Resend with correct email address for Sudeep > > drivers/base/arch_topology.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 5aaa0865625d..2aa0c6425290 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -417,9 +417,6 @@ init_cpu_capacity_callback(struct notifier_block *nb, > struct cpufreq_policy *policy = data; > int cpu; > > - if (!raw_capacity) > - return 0; > - > if (val != CPUFREQ_CREATE_POLICY) > return 0; > > @@ -436,9 +433,11 @@ init_cpu_capacity_callback(struct notifier_block *nb, > } > > if (cpumask_empty(cpus_to_visit)) { > - topology_normalize_cpu_scale(); > - schedule_work(&update_topology_flags_work); > - free_raw_capacity(); > + if (raw_capacity) { > + topology_normalize_cpu_scale(); > + schedule_work(&update_topology_flags_work); > + free_raw_capacity(); > + } > pr_debug("cpu_capacity: parsing done\n"); > schedule_work(&parsing_done_work); > } > @@ -458,7 +457,7 @@ static int __init register_cpufreq_notifier(void) > * On ACPI-based systems skip registering cpufreq notifier as cpufreq > * information is not needed for cpu capacity initialization. > */ > - if (!acpi_disabled || !raw_capacity) > + if (!acpi_disabled) > return -EINVAL; > > if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL))