All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Philippe Longepe <philippe.longepe@linux.intel.com>,
	linux-pm@vger.kernel.org
Cc: rafael@kernel.org
Subject: Re: [PATCH V5 1/4] Remove extra conversions in pid calculation
Date: Mon, 07 Mar 2016 13:30:50 -0800	[thread overview]
Message-ID: <1457386250.4361.7.camel@linux.intel.com> (raw)
In-Reply-To: <1457249646-23072-2-git-send-email-philippe.longepe@linux.intel.com>

On Sun, 2016-03-06 at 08:34 +0100, Philippe Longepe wrote:
> pid->setpoint and pid->deadband can be initialize in float so we
> can remove the int_tofp in pid_calc.

Rafael had some comments on this patch:
"s/initialize/initialized/

> can remove the int_tofp in pid_calc.

This is not "float", but "fixed point".

Also "avoid" rather than "remove".
"
Not sure if Rafael is OK without change.

> Signed-off-by: Philippe Longepe <philippe.longepe@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index eb0aef0..114e4e0 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -198,8 +198,8 @@ static struct perf_limits *limits =
> &powersave_limits;
>  
>  static inline void pid_reset(struct _pid *pid, int setpoint, int
> busy,
>  			     int deadband, int integral) {
> -	pid->setpoint = setpoint;
> -	pid->deadband  = deadband;
> +	pid->setpoint = int_tofp(setpoint);
> +	pid->deadband  = int_tofp(deadband);
>  	pid->integral  = int_tofp(integral);
>  	pid->last_err  = int_tofp(setpoint) - int_tofp(busy);
>  }
> @@ -225,9 +225,9 @@ static signed int pid_calc(struct _pid *pid,
> int32_t busy)
>  	int32_t pterm, dterm, fp_error;
>  	int32_t integral_limit;
>  
> -	fp_error = int_tofp(pid->setpoint) - busy;
> +	fp_error = pid->setpoint - busy;
>  
> -	if (abs(fp_error) <= int_tofp(pid->deadband))
> +	if (abs(fp_error) <= pid->deadband)
>  		return 0;
>  
>  	pterm = mul_fp(pid->p_gain, fp_error);

  reply	other threads:[~2016-03-07 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06  7:34 [PATCH V5 0/4] Reduce the intel_pstate timer overhead Philippe Longepe
2016-03-06  7:34 ` [PATCH V5 1/4] Remove extra conversions in pid calculation Philippe Longepe
2016-03-07 21:30   ` Srinivas Pandruvada [this message]
2016-03-06  7:34 ` [PATCH V5 2/4] Optimize calculation for max/min_perf_adj Philippe Longepe
2016-03-07 21:35   ` Srinivas Pandruvada
2016-03-06  7:34 ` [PATCH V5 3/4] Move the intel_pstate_calc_busy into get_target_pstate_use_performance Philippe Longepe
2016-03-07 21:36   ` Srinivas Pandruvada
2016-03-06  7:34 ` [PATCH V5 4/4] intel_pstate: Remove the freq calculation from the intel_pstate_calc_busy function Philippe Longepe
2016-03-07 21:42   ` Srinivas Pandruvada

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=1457386250.4361.7.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=philippe.longepe@linux.intel.com \
    --cc=rafael@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.