cpufreq: remove policy from cpufreq_policy_list during suspend
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 20 Aug 2013 06:38:23 +0000 (12:08 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 20 Aug 2013 13:43:50 +0000 (15:43 +0200)
commit9515f4d69b92feafe37581047a1bb41e41602faa
treee36e7c5c978e7a84c7af393340ba28d55296a9dc
parentedab2fbc21b9eb37007ad8bffe1159d536bbb451
cpufreq: remove policy from cpufreq_policy_list during suspend

cpufreq_policy_list is a list of active policies.  We do remove
policies from this list when all CPUs belonging to that policy are
removed.  But during system suspend we don't really free a policy
struct as it will be used again during resume, so we didn't remove
it from cpufreq_policy_list as well..

However, this is incorrect.  We are saying this policy isn't valid
anymore and must not be referenced (though we haven't freed it), but
it can still be used by code that iterates over cpufreq_policy_list.

Remove policy from this list during system suspend as well.
Of course, we must add it back whenever the first CPU belonging to
that policy shows up.

[rjw: Changelog]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c