• Doug Anderson's avatar
    cpufreq: suspend cpufreq governors on shutdown · 90de2a4a
    Doug Anderson authored
    We should stop cpufreq governors when we shut down the system.  If we
    don't do this, we can end up with this deadlock:
    
    1. cpufreq governor may be running on a CPU other than CPU0.
    2. In machine_restart() we call smp_send_stop() which stops CPUs.
       If one of these CPUs was actively running a cpufreq governor
       then it may have the mutex / spinlock needed to access the main
       PMIC in the system (perhaps over I2C)
    3. If a machine needs access to the main PMIC in order to shutdown
       then it will never get it since the mutex was lost when the other
       CPU stopped.
    4. We'll hang (possibly eventually hitting the hard lockup detector).
    
    Let's avoid the problem by stopping the cpufreq governor at shutdown,
    which is a sensible thing to do anyway.
    Signed-off-by: default avatarDoug Anderson <dianders@chromium.org>
    Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    90de2a4a
cpufreq.c 65.6 KB