• D
    cpufreq: suspend cpufreq governors on shutdown · 90de2a4a
    Doug Anderson 提交于
    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: NDoug Anderson <dianders@chromium.org>
    Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    90de2a4a
cpufreq.c 65.6 KB