[lkml]   [2013]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 6/7] cpufreq: Preserve policy structure across suspend/resume
On 30 July 2013 04:25, Srivatsa S. Bhat
<> wrote:
> To perform light-weight cpu-init and teardown in the cpufreq subsystem
> during suspend/resume, we need to separate out the 2 main functionalities
> of the cpufreq CPU hotplug callbacks, as outlined below:
> 1. Init/tear-down of core cpufreq and CPU-specific components, which are
> critical to the correct functioning of the cpufreq subsystem.
> 2. Init/tear-down of cpufreq sysfs files during suspend/resume.
> The first part requires accurate updates to the policy structure such as
> its ->cpus and ->related_cpus masks, whereas the second part requires that
> the policy->kobj structure is not released or re-initialized during
> suspend/resume.
> To handle both these requirements, we need to allow updates to the policy
> structure throughout suspend/resume, but prevent the structure from getting
> freed up. Also, we must have a mechanism by which the cpu-up callbacks can
> restore the policy structure, without allocating things afresh. (That also
> helps avoid memory leaks).
> To achieve this, we use 2 schemes:
> a. Use a fallback per-cpu storage area for preserving the policy structures
> during suspend, so that they can be restored during resume appropriately.
> b. Use the 'frozen' flag to determine when to free or allocate the policy
> structure vs when to restore the policy from the saved fallback storage.
> Thus we can successfully preserve the structure across suspend/resume.
> Effectively, this helps us complete the separation of the 'light-weight'
> and the 'full' init/tear-down sequences in the cpufreq subsystem, so that
> this can be made use of in the suspend/resume scenario.
> Signed-off-by: Srivatsa S. Bhat <>
> ---
> drivers/cpufreq/cpufreq.c | 69 +++++++++++++++++++++++++++++++++++----------
> 1 file changed, 53 insertions(+), 16 deletions(-)

Acked-by: Viresh Kumar <>

 \ /
  Last update: 2013-07-30 12:01    [W:0.202 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site