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]
Message-ID: <CAJZ5v0hPV+hhUqC3i2CWU1NT35tBrTAA20mFnhAudS8xCi8MtA@mail.gmail.com>
Date:   Tue, 7 Feb 2023 20:54:10 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc:     rafael@...nel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, daniel.lezcano@...aro.org,
        rui.zhang@...el.com
Subject: Re: [PATCH v2] thermal: intel_powerclamp: Return last requested state
 as cur_state

On Sat, Feb 4, 2023 at 5:29 AM 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>
> ---
> v2:
> Fixed setting of *state
>
>  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 5f54c88b1977..0282503ecaaf 100644
> --- a/drivers/thermal/intel/intel_powerclamp.c
> +++ b/drivers/thermal/intel/intel_powerclamp.c
> @@ -539,17 +539,7 @@ static int powerclamp_get_cur_state(struct thermal_cooling_device *cdev,
>                                  unsigned long *state)
>  {
>         mutex_lock(&powerclamp_lock);
> -
> -       if (powerclamp_data.clamping) {
> -               if (poll_pkg_cstate_enable)
> -                       *state = pkg_cstate_ratio_cur;
> -               else
> -                       *state = powerclamp_data.target_ratio;
> -       } else {
> -               /* to save power, do not poll idle ratio while not clamping */
> -               *state = -1; /* indicates invalid state */
> -       }
> -
> +       *state = powerclamp_data.target_ratio;
>         mutex_unlock(&powerclamp_lock);
>
>         return 0;
> --

Applied as 6.3 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ