diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-10-29 09:26:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-30 19:11:08 -0400 |
commit | 7dbf694db6ac7c759599316d50d7050efcbd512a (patch) | |
tree | fe10dc555181b52a8fd567dcf819d5a447bb1f37 | |
parent | e0a261a207fb5bcbc6cc5db3b51a96d9cbe9b97e (diff) |
cpufreq: distinguish drivers that do asynchronous notifications
There are few special cases like exynos5440 which doesn't send POSTCHANGE
notification from their ->target() routine and call some kind of bottom halves
for doing this work, work/tasklet/etc.. From which they finally send POSTCHANGE
notification.
Its better if we distinguish them from other cpufreq drivers in some way so that
core can handle them specially. So this patch introduces another flag:
CPUFREQ_ASYNC_NOTIFICATION, which will be set by such drivers.
This also changes exynos5440-cpufreq.c and powernow-k8 in order to set this
flag.
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/exynos5440-cpufreq.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k8.c | 1 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 1bf9b060d522..76bef8b078cb 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c | |||
@@ -312,7 +312,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
312 | } | 312 | } |
313 | 313 | ||
314 | static struct cpufreq_driver exynos_driver = { | 314 | static struct cpufreq_driver exynos_driver = { |
315 | .flags = CPUFREQ_STICKY, | 315 | .flags = CPUFREQ_STICKY | CPUFREQ_ASYNC_NOTIFICATION, |
316 | .verify = cpufreq_generic_frequency_table_verify, | 316 | .verify = cpufreq_generic_frequency_table_verify, |
317 | .target_index = exynos_target, | 317 | .target_index = exynos_target, |
318 | .get = exynos_getspeed, | 318 | .get = exynos_getspeed, |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 62a1ce47d3df..0023c7d40a51 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
@@ -1204,6 +1204,7 @@ out: | |||
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | static struct cpufreq_driver cpufreq_amd64_driver = { | 1206 | static struct cpufreq_driver cpufreq_amd64_driver = { |
1207 | .flags = CPUFREQ_ASYNC_NOTIFICATION, | ||
1207 | .verify = cpufreq_generic_frequency_table_verify, | 1208 | .verify = cpufreq_generic_frequency_table_verify, |
1208 | .target_index = powernowk8_target, | 1209 | .target_index = powernowk8_target, |
1209 | .bios_limit = acpi_processor_get_bios_limit, | 1210 | .bios_limit = acpi_processor_get_bios_limit, |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 93a8c34d6c7f..5bd6ab9b0c27 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -237,6 +237,13 @@ struct cpufreq_driver { | |||
237 | */ | 237 | */ |
238 | #define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) | 238 | #define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) |
239 | 239 | ||
240 | /* | ||
241 | * Driver will do POSTCHANGE notifications from outside of their ->target() | ||
242 | * routine and so must set cpufreq_driver->flags with this flag, so that core | ||
243 | * can handle them specially. | ||
244 | */ | ||
245 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) | ||
246 | |||
240 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 247 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
241 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 248 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
242 | 249 | ||