linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Abhishek Goel <huntbag@linux.vnet.ibm.com>, ego@linux.vnet.ibm.com
Cc: rjw@rjwysocki.net, benh@kernel.crashing.org, paulus@samba.org,
	mpe@ellerman.id.au, linux-pm@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: powernv: Add support of frequency domain
Date: Thu, 14 Dec 2017 10:12:39 +0530	[thread overview]
Message-ID: <20171214044239.GU3322@vireshk-i7> (raw)
In-Reply-To: <20171213081937.16376-1-huntbag@linux.vnet.ibm.com>

+ Gautham,

@Gautham: Can you please help reviewing this one ?

On 13-12-17, 13:49, Abhishek Goel wrote:
> @@ -693,6 +746,8 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>  {
>  	struct powernv_smp_call_data freq_data;
>  	unsigned int cur_msec, gpstate_idx;
> +	cpumask_t temp;
> +	u32 cpu;
>  	struct global_pstate_info *gpstates = policy->driver_data;
>  
>  	if (unlikely(rebooting) && new_index != get_nominal_index())
> @@ -761,24 +816,48 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>  	spin_unlock(&gpstates->gpstate_lock);
>  
>  	/*
> -	 * Use smp_call_function to send IPI and execute the
> -	 * mtspr on target CPU.  We could do that without IPI
> -	 * if current CPU is within policy->cpus (core)
> +	 * Use smp_call_function to send IPI and execute the mtspr on CPU.
> +	 * This needs to be done on every core of the policy

Why on each CPU ?

>  	 */
> -	smp_call_function_any(policy->cpus, set_pstate, &freq_data, 1);
> +	cpumask_copy(&temp, policy->cpus);
> +
> +	while (!cpumask_empty(&temp)) {
> +		cpu = cpumask_first(&temp);
> +		smp_call_function_any(cpu_sibling_mask(cpu),
> +					set_pstate, &freq_data, 1);
> +		cpumask_andnot(&temp, &temp, cpu_sibling_mask(cpu));
> +	}
> +
>  	return 0;
>  }

-- 
viresh

  reply	other threads:[~2017-12-14  4:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  8:19 [PATCH] cpufreq: powernv: Add support of frequency domain Abhishek Goel
2017-12-14  4:42 ` Viresh Kumar [this message]
2017-12-18  5:11   ` Abhishek
2017-12-18  8:29     ` Viresh Kumar
2017-12-19  9:20       ` Gautham R Shenoy
2017-12-19 10:21         ` Balbir Singh
2017-12-20  8:04           ` Gautham R Shenoy

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=20171214044239.GU3322@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=benh@kernel.crashing.org \
    --cc=ego@linux.vnet.ibm.com \
    --cc=huntbag@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).