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=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 B3F6CC4338F for ; Wed, 11 Aug 2021 14:41:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 717B060C40 for ; Wed, 11 Aug 2021 14:41:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 717B060C40 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KBWBPbq4+bOlNnr5RdLziVJ4IOnbJI/RRkQiuZB4usY=; b=XsQZLc6OPF2Mcw uVAJ5Kb3tMBwHyK2szTF4lu0RYuIvD3gyOkRk1KUnwuexPk2NDVxo2IDCTyzUsifULSM2LVmzv33H e4bca/ZG2gFyHGU4yTDEBWDbnha3Rj3P7HYNoHUlC/jMNOSSzVkss+Yzaw0awtDRgoL3Isxou/fL2 sFTzHdoe8jtxZNsJBvHqZVlhHLcAfOvwEzPI+A4kE6hvKJI+KahN4Qpg9tVsMpcp0rXlJO1A4/grb ZVk1xkDCBr8GTw1FGY8BTRhBzxcd9fovzjp5CmzbHjKPhSgsCYs97CISnzxdI4YjkMy3frxtIVAX9 ++KoXzNLHoEtU3z6IQ2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDpOR-007Sbt-4h; Wed, 11 Aug 2021 14:39:43 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDpON-007SbD-Kd for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 14:39:41 +0000 Received: by mail-wm1-x330.google.com with SMTP id m36-20020a05600c3b24b02902e67543e17aso3957387wms.0 for ; Wed, 11 Aug 2021 07:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Gdt8lIjV6iD7SQvCjoFoUXFp8NNjB2qyZ0eN4tD/1G0=; b=DBDuQvZD0UIyI7Y7ZQl0EawBBOTfUFUj8fQBZTzqbVZI8OPdKTQ/OSyfKe3AxsN8sl G9ybap+FG06KwTIp3NLpkFvzI26uySZdMywdZ26OyQ9FFKYwWXfmzUUYhu4IJ577Mti2 8XoGP4Z+mY/Ycd6eqZYYYN6kACBQQ8En9cilDT/92mUYOIZwx+bgxjCgh/ywSNP3h1R9 Js+yPydRUXV3qCVrRTwgusvInINW6Wh/4M/dsX4FVokHfB4i7syKk5vDsWLWBnGUuW08 EpXUCCKDTXHx7nTl3cVVt2R6U8fcQSrPr4zvyWfNSHD7JsSypvM8QbhvVvc0BXdBao8s yZXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Gdt8lIjV6iD7SQvCjoFoUXFp8NNjB2qyZ0eN4tD/1G0=; b=B5qJkAecYniOEWz8Don3T+itFrZmbHIkSIKZyLChqNYD5KYKkrKa7+o1HmE1c2sz4+ 7PJCuHa+RjWOQyiXqs4/fGtTvCtz6r/aATu60v8wJSqOeKtpZO4mubqROeo3AytvwvKY FHxK3hU9WZu7TTj0IARPoGE2h22kuhEBtmYc23+NretNZjueb/jc9/nHafzM1NKhv8fX GD2jrUpCgWNT9ykKMa0V5ZCw1WveHr+B41dkeJU/N7M3RfFSzB+jiFE0Lpe32CYNeHZR uAzFLFmB1upT7Ukw+7lvHt5pk4p3kfgcvoeTah+HWmIlaK9y7cgaKCI6UjLrB7C40gSK wJ2Q== X-Gm-Message-State: AOAM533g0BXO+Nglhld4OmLgdXT5jJ8gNZuBV+J0Vbyylv0gsS9+bRo+ bLan6/nm4C0cV9Dvalwlv+cK0Q== X-Google-Smtp-Source: ABdhPJymFwE8deJDEUQN95xYHSVUV02wjbndxGNU77LOz1RKXXiK9Tf21LKPwUIa+gJMzFfHx/e+kQ== X-Received: by 2002:a1c:f00a:: with SMTP id a10mr22252909wmb.112.1628692777433; Wed, 11 Aug 2021 07:39:37 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:43fd:e634:73d9:e10e]) by smtp.gmail.com with ESMTPSA id g12sm27079366wri.49.2021.08.11.07.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 07:39:37 -0700 (PDT) Date: Wed, 11 Aug 2021 15:39:31 +0100 From: Quentin Perret To: Lukasz Luba 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 Subject: Re: [PATCH V2 9/9] cpufreq: scmi: Use .register_em() callback Message-ID: References: <6094d891b4cb0cba3357e2894c8a4431c4c65e67.1628682874.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_073939_736737_FDC4DF37 X-CRM114-Status: GOOD ( 21.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 ... 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel