• Viresh Kumar's avatar
    cpufreq: suspend governors on system suspend/hibernate · 2f0aea93
    Viresh Kumar authored
    This patch adds cpufreq suspend/resume calls to dpm_{suspend|resume}()
    for handling suspend/resume of cpufreq governors.
    
    Lan Tianyu (Intel) & Jinhyuk Choi (Broadcom) found an issue where the
    tunables configuration for clusters/sockets with non-boot CPUs was
    lost after system suspend/resume, as we were notifying governors with
    CPUFREQ_GOV_POLICY_EXIT on removal of the last CPU for that policy
    which caused the tunables memory to be freed.
    
    This is fixed by preventing any governor operations from being
    carried out between the device suspend and device resume stages of
    system suspend and resume, respectively.
    
    We could have added these callbacks at dpm_{suspend|resume}_noirq()
    level, but there is an additional problem that the majority of I/O
    devices is already suspended at that point and if cpufreq drivers
    want to change the frequency before suspending, then that not be
    possible on some platforms (which depend on peripherals like i2c,
    regulators, etc).
    Reported-and-tested-by: default avatarLan Tianyu <tianyu.lan@intel.com>
    Reported-by: default avatarJinhyuk Choi <jinchoi@broadcom.com>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    [rjw: Changelog]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    2f0aea93
cpufreq.c 60.4 KB