From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CA95C432BE for ; Wed, 11 Aug 2021 15:54:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6647D60FC3 for ; Wed, 11 Aug 2021 15:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233672AbhHKPye (ORCPT ); Wed, 11 Aug 2021 11:54:34 -0400 Received: from foss.arm.com ([217.140.110.172]:53490 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233507AbhHKPxY (ORCPT ); Wed, 11 Aug 2021 11:53:24 -0400 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 AC5851063; Wed, 11 Aug 2021 08:53:00 -0700 (PDT) Received: from [10.57.12.152] (unknown [10.57.12.152]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A752C3F718; Wed, 11 Aug 2021 08:52:58 -0700 (PDT) Subject: Re: [PATCH V2 9/9] cpufreq: scmi: Use .register_em() callback To: Quentin Perret Cc: Viresh Kumar , Rafael Wysocki , Sudeep Holla , Cristian Marussi , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <6094d891b4cb0cba3357e2894c8a4431c4c65e67.1628682874.git.viresh.kumar@linaro.org> From: Lukasz Luba Message-ID: <31d73514-0d60-3239-a727-0ae483f11c31@arm.com> Date: Wed, 11 Aug 2021 16:52:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/21 3:39 PM, Quentin Perret wrote: > On Wednesday 11 Aug 2021 at 15:09:13 (+0100), Lukasz Luba wrote: >> >> >> On 8/11/21 2:17 PM, Quentin Perret wrote: >>> On Wednesday 11 Aug 2021 at 17:28:47 (+0530), Viresh Kumar wrote: >>>> Set the newly added .register_em() callback to register with the EM >>>> after the cpufreq policy is properly initialized. >>>> >>>> Signed-off-by: Viresh Kumar >>>> --- >>>> drivers/cpufreq/scmi-cpufreq.c | 55 ++++++++++++++++++++-------------- >>>> 1 file changed, 32 insertions(+), 23 deletions(-) >>>> >>>> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >>>> index 75f818d04b48..b916c9e22921 100644 >>>> --- a/drivers/cpufreq/scmi-cpufreq.c >>>> +++ b/drivers/cpufreq/scmi-cpufreq.c >>>> @@ -22,7 +22,9 @@ >>>> struct scmi_data { >>>> int domain_id; >>>> + int nr_opp; >>>> struct device *cpu_dev; >>>> + cpumask_var_t opp_shared_cpus; >>> >>> Can we use policy->related_cpus and friends directly in the callback >> >> Unfortunately not. This tricky setup code was introduced because we may >> have a platform with per-CPU policy, so single bit set in >> policy->related_cpus, but we want EAS to be still working on set >> of CPUs. That's why we construct temporary cpumask and pass it to EM. > > Aha, I see this now. Hmm, those platforms better have AMUs then, > otherwise PELT signals will be wonky ... That's the plan, to have the AMUs. We suggest that, but reality would tell... ;) > > I was going to suggest using dev_pm_opp_get_sharing_cpus() from the > callback instead, but maybe that's overkill as we'd need to allocate a > temporary cpumask and all. So n/m this patch should be fine as is. >