Skip to content
  • Viresh Kumar's avatar
    cpufreq: Simplify __cpufreq_remove_dev() · b8eed8af
    Viresh Kumar authored
    
    
    __cpufreq_remove_dev() is called on multiple occasions: cpufreq_driver
    unregister and cpu removals.
    
    Current implementation of this routine is overly complex without much need. If
    the cpu to be removed is the policy->cpu, we remove the policy first and add all
    other cpus again from policy->cpus and then finally call __cpufreq_remove_dev()
    again to remove the cpu to be deleted. Haahhhh..
    
    There exist a simple solution to removal of a cpu:
    - Simply use the old policy structure
    - update its fields like: policy->cpu, etc.
    - notify any users of cpufreq, which depend on changing policy->cpu
    
    Hence this patch, which tries to implement the above theory. It is tested well
    by myself on ARM big.LITTLE TC2 SoC, which has 5 cores (2 A15 and 3 A7). Both
    A15's share same struct policy and all A7's share same policy structure.
    
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Tested-by: default avatarShawn Guo <shawn.guo@linaro.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    b8eed8af