mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	daniel.lezcano@linaro.org, rui.zhang@intel.com
Subject: Re: [PATCH] thermal: intel_powerclamp: Return last requested state as cur_state
Date: Thu, 02 Feb 2023 14:21:29 -0800	[thread overview]
Message-ID: <2eb7f5335241cc9ca2f31761766e8cb34cfaa42d.camel@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0ieQocb2oe1ggDCOos4HtkmypsadMkXCwH2J5XmRUdVyQ@mail.gmail.com>

On Thu, 2023-02-02 at 17:44 +0100, Rafael J. Wysocki wrote:
> On Wed, Feb 1, 2023 at 10:07 PM Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> > 
> > When the user is reading cur_state from the thermal cooling device
> > for
> > Intel powerclamp device:
> > - It returns the idle ratio from Package C-state counters when
> > there is active idle injection session.
> > - -1, when there is no active idle injection session.
> > 
> > This information is not very useful as the package C-state counters
> > vary
> > a lot from read to read. Instead just return the last requested
> > cur_state.
> > 
> > Signed-off-by: Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com>
> > ---
> >  drivers/thermal/intel/intel_powerclamp.c | 12 +-----------
> >  1 file changed, 1 insertion(+), 11 deletions(-)
> > 
> > diff --git a/drivers/thermal/intel/intel_powerclamp.c
> > b/drivers/thermal/intel/intel_powerclamp.c
> > index 2f4cbfdf26a0..72a45cf2708c 100644
> > --- a/drivers/thermal/intel/intel_powerclamp.c
> > +++ b/drivers/thermal/intel/intel_powerclamp.c
> > @@ -590,17 +590,7 @@ static int powerclamp_get_max_state(struct
> > thermal_cooling_device *cdev,
> >  static int powerclamp_get_cur_state(struct thermal_cooling_device
> > *cdev,
> >                                  unsigned long *state)
> >  {
> > -       if (clamping) {
> > -               if (poll_pkg_cstate_enable)
> > -                       *state = pkg_cstate_ratio_cur;
> > -               else
> > -                       *state = set_target_ratio;
> > -       } else {
> > -               /* to save power, do not poll idle ratio while not
> > clamping */
> > -               *state = -1; /* indicates invalid state */
> > -       }
> > -
> > -       return 0;
> > +       return set_target_ratio;
> 
> *state = set_target_ratio;
> return 0;
> 
Sorry.

What a blunder! Sent patch from 37000 ft. Should never do that.

Thanks,
Srinivas


> >  }
> > 
> >  static int powerclamp_set_cur_state(struct thermal_cooling_device
> > *cdev,
> > --
> 
> And please rebase it on top of the idle_inject series (which is being
> added to my bleeding-edge branch right now).


  reply	other threads:[~2023-02-02 22:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 21:07 Srinivas Pandruvada
2023-02-02 16:44 ` Rafael J. Wysocki
2023-02-02 22:21   ` srinivas pandruvada [this message]
2023-02-03 13:59     ` Rafael J. Wysocki

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=2eb7f5335241cc9ca2f31761766e8cb34cfaa42d.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /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

all inboxes | Powered by JetHome®