All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Mazzucato <nicola.mazzucato@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
	sudeep.holla@arm.com, rjw@rjwysocki.net, vireshk@kernel.org,
	cristian.marussi@arm.com, morten.rasmussen@arm.com,
	chris.redpath@arm.com, ionela.voinescu@arm.com
Subject: Re: [PATCH v7 2/3] scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM
Date: Thu, 18 Feb 2021 13:02:11 +0000	[thread overview]
Message-ID: <8efd2c71-847d-398a-5605-1daf9c2a3e75@arm.com> (raw)
In-Reply-To: <20210218110013.2b4ow7fzldra2srj@vireshk-i7>

Hi Viresh,


On 2/18/21 11:00 AM, Viresh Kumar wrote:
> On 15-02-21, 07:51, Nicola Mazzucato wrote:
>> +	/*
>> +	 * Add OPPs only on those CPUs for which we haven't already done so.
>> +	 */
>>  	nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
> 
> Please add a more detailed comment here explaining why you expect OPPs
> to be present here in advance. i.e. you _may_ have policy per CPU even
> though OPP core says OPPs are shared.. It is not straight forward to
> catch otherwise.

Sure, I'll put more details, thanks.

> 
>>  	if (nr_opp <= 0) {
>> -		dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
>> -			__func__, ret);
>> -
>> -		ret = -ENODEV;
>> -		goto out_free_priv;
>> +		ret = handle->perf_ops->device_opps_add(handle, cpu_dev);
>> +		if (ret) {
>> +			dev_warn(cpu_dev, "failed to add opps to the device\n");
>> +			goto out_free_cpumask;
>> +		}
>> +
>> +		nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
>> +		if (nr_opp <= 0) {
>> +			dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
>> +				__func__, ret);
>> +
>> +			ret = -ENODEV;
>> +			goto out_free_opp;
>> +		}
>> +
>> +		ret = dev_pm_opp_set_sharing_cpus(cpu_dev, opp_shared_cpus);
>> +		if (ret) {
>> +			dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
>> +				__func__, ret);
>> +
>> +			goto out_free_opp;
>> +		}
>> +
>> +		power_scale_mw = handle->perf_ops->power_scale_mw_get(handle);
>> +		em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb,
>> +					    opp_shared_cpus, power_scale_mw);
>>  	}
> 

WARNING: multiple messages have this Message-ID (diff)
From: Nicola Mazzucato <nicola.mazzucato@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, vireshk@kernel.org, rjw@rjwysocki.net,
	linux-kernel@vger.kernel.org, cristian.marussi@arm.com,
	sudeep.holla@arm.com, chris.redpath@arm.com,
	ionela.voinescu@arm.com, morten.rasmussen@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 2/3] scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM
Date: Thu, 18 Feb 2021 13:02:11 +0000	[thread overview]
Message-ID: <8efd2c71-847d-398a-5605-1daf9c2a3e75@arm.com> (raw)
In-Reply-To: <20210218110013.2b4ow7fzldra2srj@vireshk-i7>

Hi Viresh,


On 2/18/21 11:00 AM, Viresh Kumar wrote:
> On 15-02-21, 07:51, Nicola Mazzucato wrote:
>> +	/*
>> +	 * Add OPPs only on those CPUs for which we haven't already done so.
>> +	 */
>>  	nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
> 
> Please add a more detailed comment here explaining why you expect OPPs
> to be present here in advance. i.e. you _may_ have policy per CPU even
> though OPP core says OPPs are shared.. It is not straight forward to
> catch otherwise.

Sure, I'll put more details, thanks.

> 
>>  	if (nr_opp <= 0) {
>> -		dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
>> -			__func__, ret);
>> -
>> -		ret = -ENODEV;
>> -		goto out_free_priv;
>> +		ret = handle->perf_ops->device_opps_add(handle, cpu_dev);
>> +		if (ret) {
>> +			dev_warn(cpu_dev, "failed to add opps to the device\n");
>> +			goto out_free_cpumask;
>> +		}
>> +
>> +		nr_opp = dev_pm_opp_get_opp_count(cpu_dev);
>> +		if (nr_opp <= 0) {
>> +			dev_err(cpu_dev, "%s: No OPPs for this device: %d\n",
>> +				__func__, ret);
>> +
>> +			ret = -ENODEV;
>> +			goto out_free_opp;
>> +		}
>> +
>> +		ret = dev_pm_opp_set_sharing_cpus(cpu_dev, opp_shared_cpus);
>> +		if (ret) {
>> +			dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
>> +				__func__, ret);
>> +
>> +			goto out_free_opp;
>> +		}
>> +
>> +		power_scale_mw = handle->perf_ops->power_scale_mw_get(handle);
>> +		em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb,
>> +					    opp_shared_cpus, power_scale_mw);
>>  	}
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-02-18 15:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15  7:51 [PATCH v7 0/3] CPUFreq: Add support for opp-sharing cpus Nicola Mazzucato
2021-02-15  7:51 ` Nicola Mazzucato
2021-02-15  7:51 ` [PATCH v7 1/3] scmi-cpufreq: Remove deferred probe Nicola Mazzucato
2021-02-15  7:51   ` Nicola Mazzucato
2021-02-18 10:35   ` Viresh Kumar
2021-02-18 10:35     ` Viresh Kumar
2021-02-18 13:01     ` Nicola Mazzucato
2021-02-18 13:01       ` Nicola Mazzucato
2021-02-15  7:51 ` [PATCH v7 2/3] scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM Nicola Mazzucato
2021-02-15  7:51   ` Nicola Mazzucato
2021-02-18 11:00   ` Viresh Kumar
2021-02-18 11:00     ` Viresh Kumar
2021-02-18 13:02     ` Nicola Mazzucato [this message]
2021-02-18 13:02       ` Nicola Mazzucato
2021-02-15  7:51 ` [PATCH v7 3/3] cpufreq: blacklist Arm Vexpress platforms in cpufreq-dt-platdev Nicola Mazzucato
2021-02-15  7:51   ` Nicola Mazzucato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8efd2c71-847d-398a-5605-1daf9c2a3e75@arm.com \
    --to=nicola.mazzucato@arm.com \
    --cc=chris.redpath@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=ionela.voinescu@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.