• Viresh Kumar's avatar
    cpufreq: Avoid calling cpufreq_verify_current_freq() from handle_update() · 70a59fde
    Viresh Kumar authored
    On some occasions cpufreq_verify_current_freq() schedules a work whose
    callback is handle_update(), which further calls cpufreq_update_policy()
    which may end up calling cpufreq_verify_current_freq() again.
    
    On the other hand, when cpufreq_update_policy() is called from
    handle_update(), the pointer to the cpufreq policy is already
    available, but cpufreq_cpu_acquire() is still called to get it in
    cpufreq_update_policy(), which should be avoided as well.
    
    To fix these issues, create a new helper, refresh_frequency_limits(),
    and make both handle_update() call it cpufreq_update_policy().
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    [ rjw: Rename reeval_frequency_limits() as refresh_frequency_limits() ]
    [ rjw: Changelog ]
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    70a59fde
cpufreq.c 69.3 KB