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: <CAKohpokht4=7XCftPYa5PqpPMN-O-5b_RjJ3BgHnxjYV4VzyTg@mail.gmail.com>
Date:	Mon, 29 Sep 2014 01:20:44 -0700
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Lan Tianyu <tianyu.lan@...el.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Dirk Brandewie <dirk.j.brandewie@...el.com>
Subject: Re: [PATCH 1/1] Cpufreq: Keep cpufreq sysfs nodes across S2RAM/S2DISK
 when using intel_pstate driver.

Sorry for being late on this. Was away for a week for Linaro Connect followed
by a week of vacations :(

On 18 September 2014 00:03, Lan Tianyu <tianyu.lan@...el.com> wrote:
> Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
> across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
> for cpufreq drivers which have target or target_index callback. This
> skips intel_pstate driver. This patch is to set the flag before checking
> target or target_index callback.

Oh yes, this looks to be the right thing to do..

> Signed-off-by: Lan Tianyu <tianyu.lan@...el.com>
> ---
>  drivers/cpufreq/cpufreq.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d9fdedd..eb9bb78 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1656,6 +1656,8 @@ void cpufreq_suspend(void)
>         if (!cpufreq_driver)
>                 return;
>
> +       cpufreq_suspended = true;
> +
>         if (!has_target())
>                 return;
>
> @@ -1670,8 +1672,6 @@ void cpufreq_suspend(void)
>                         pr_err("%s: Failed to suspend driver: %p\n", __func__,
>                                 policy);
>         }
> -
> -       cpufreq_suspended = true;

But this change is buggy.. Because you are updating 'cpufreq_suspended'
before actually stopping the governor, any calls to __cpufreq_governor()
will be converted to NO-operations because of this in __cpufreq_governor():

/* Don't start any governor operations if we are entering suspend */
if (cpufreq_suspended)
    return 0;

And so the governor's will never stop :(

So you need to keep the above line where it was :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ