cpufreq: governors: Fix CPUFREQ_GOV_POLICY_{INIT|EXIT} notifiers
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 30 Apr 2013 14:32:17 +0000 (14:32 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 12 May 2013 12:04:16 +0000 (14:04 +0200)
commita97c98adddbe98e824b69e6d7b320c8dc91fe581
tree2811ba6a9cbc3e594a74734c5c69a6a3e6683d52
parent2b80f3138e8470194745a6b954b4905060ab4067
cpufreq: governors: Fix CPUFREQ_GOV_POLICY_{INIT|EXIT} notifiers

There are two types of INIT/EXIT activities that we need to do for
governors:
 - Done only once per governor (doesn't depend how many instances of
   the governor there are). eg: cpufreq_register_notifier() for
   conservative governor.
 - Done per governor instance, eg: sysfs_{create|remove}_group().

There were some corner cases where current code isn't able to handle
them separately and so failing for some test cases.

We use two separate variables now for keeping track of above two
requirements.
 - governor->initialized for first one
 - dbs_data->usage_count for per governor instance

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