lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 3 Feb 2023 14:59:16 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, daniel.lezcano@...aro.org,
        rui.zhang@...el.com
Subject: Re: [PATCH] thermal: intel_powerclamp: Return last requested state as cur_state

On Thu, Feb 2, 2023 at 11:21 PM srinivas pandruvada
<srinivas.pandruvada@...ux.intel.com> wrote:
>
> 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@...ux.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@...ux.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.

No worries.

I didn't realize that you were traveling.

I can prepare this patch myself just fine if that helps.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ