[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160407120503.GG3201@vireshk-i7>
Date: Thu, 7 Apr 2016 17:35:03 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux PM list <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [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
Powered by blists - more mailing lists