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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHLCerOFg30GEaQgV=4ccgA1fG6P3OTgaG33pw-3YCtuD5mSmA@mail.gmail.com>
Date:   Tue, 24 Mar 2020 02:35:09 +0530
From:   Amit Kucheria <amit.kucheria@...durent.com>
To:     Willy Wolff <willy.mh.wolff.ml@...il.com>
Cc:     Amit Daniel Kachhap <amit.kachhap@...il.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Javi Merino <javi.merino@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Linux PM list <linux-pm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Rafael J.Wysocki" <rjw@...ysocki.net>
Subject: Re: [PATCH] thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state

Hi Willy,

On Sat, Mar 21, 2020 at 2:57 PM Willy Wolff <willy.mh.wolff.ml@...il.com> wrote:
>
> The function freq_qos_update_request returns 0 or 1 describing update
> effectiveness, and a negative error code on failure. However,
> cpufreq_set_cur_state returns 0 on success or an error code otherwise.
>

Please improve the commit message with context from your earlier bug
report thread and a summary of how the problem shows up.

Thanks,
Amit



> Signed-off-by: Willy Wolff <willy.mh.wolff.ml@...il.com>
> ---
>  drivers/thermal/cpufreq_cooling.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
> index fe83d7a210d4..af55ac08e1bd 100644
> --- a/drivers/thermal/cpufreq_cooling.c
> +++ b/drivers/thermal/cpufreq_cooling.c
> @@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
>                                  unsigned long state)
>  {
>         struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
> +       int ret;
>
>         /* Request state should be less than max_level */
>         if (WARN_ON(state > cpufreq_cdev->max_level))
> @@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
>
>         cpufreq_cdev->cpufreq_state = state;
>
> -       return freq_qos_update_request(&cpufreq_cdev->qos_req,
> -                               get_state_freq(cpufreq_cdev, state));
> +       ret = freq_qos_update_request(&cpufreq_cdev->qos_req,
> +                                     get_state_freq(cpufreq_cdev, state));
> +       return ret < 0 ? ret : 0;
>  }
>
>  /* Bind cpufreq callbacks to thermal cooling device ops */
> --
> 2.20.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ