lkml.org 
[lkml]   [2016]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpufreq: Skip all governor-related actions for cpufreq_suspended set
On 07-04-16, 13:44, Rafael J. Wysocki wrote:
> I'm not sure I'm following.
>
> Without this patch fast switch is disabled when we offline the nonboot
> CPUs during suspend, because cpufreq_exit_governor() runs then, but
> the cpufreq_governor() called by it does nothing. Also
> cpufreq_governor() during nonboot CPUs online does nothing.
>
> That has to be made consistent somehow. This patch is one way.
> Another way would be to disable fast switch from the governor ->exit
> callback, but the net result would be the same.

Actually things are working fine today by chance IMO, because we don't
free the policy structures anymore while we offline CPUs.

Otherwise, policy->governor_data would have been lost together with
the policy, and governor wouldn't have worked properly after resume.

What we are doing today is something like this:

Suspend
-------

-> cpufreq_suspend()
-> STOP governor
-> cpufreq_suspended = true

-> Offline non-boot CPUs
-> cpufreq_offline()
-> SKIP calling EXIT governor (governor had allocated few
resources earlier)

Resume
------

-> Bring back non-boot CPUs
-> cpufreq_online()
-> SKIP calling INIT governor (policy->governor_data doesn't get
reset, luckily)

-> cpufreq_resume()
-> cpufreq_suspended = false
-> START governor


That's *ugly* and it works by chance, unless I am misreading it
completely.

One of the solutions to get this cleaned is to stop checking for
cpufreq_suspended flag in cpufreq_governor() and put that *only* in
places where we are trying to interact with the hardware. And that
essentially is the callbacks provided by the cpufreq drivers. So,
ignore calling cpufreq-driver callbacks if cpufreq_suspended is true.

--
viresh

\
 
 \ /
  Last update: 2016-04-07 14:21    [W:0.217 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site