Skip to content

Commit

Permalink
kernel: power: prevent DVFS_LOCK_ID_USER lock for min and max frequen…
Browse files Browse the repository at this point in the history
…cy levels
  • Loading branch information
gokhanmoral committed Oct 1, 2012
1 parent bea7b08 commit 8c9ed69
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions kernel/power/main.c
Expand Up @@ -461,20 +461,20 @@ static ssize_t cpufreq_max_limit_store(struct kobject *kobj,


if (val == -1) { /* Unlock request */ if (val == -1) { /* Unlock request */
if (cpufreq_max_limit_val != -1) { if (cpufreq_max_limit_val != -1) {
exynos_cpufreq_upper_limit_free(DVFS_LOCK_ID_USER); // exynos_cpufreq_upper_limit_free(DVFS_LOCK_ID_USER);
cpufreq_max_limit_val = -1; cpufreq_max_limit_val = -1;
} else /* Already unlocked */ } else /* Already unlocked */
printk(KERN_ERR "%s: Unlock request is ignored\n", printk(KERN_ERR "%s: Unlock request is ignored\n",
__func__); __func__);
} else { /* Lock request */ } else { /* Lock request */
if (get_cpufreq_level((unsigned int)val, &cpufreq_level) if (get_cpufreq_level((unsigned int)val, &cpufreq_level)
== VALID_LEVEL) { == VALID_LEVEL) {
if (cpufreq_max_limit_val != -1) // if (cpufreq_max_limit_val != -1)
/* Unlock the previous lock */ /* Unlock the previous lock */
exynos_cpufreq_upper_limit_free( // exynos_cpufreq_upper_limit_free(
DVFS_LOCK_ID_USER); // DVFS_LOCK_ID_USER);
lock_ret = exynos_cpufreq_upper_limit( // lock_ret = exynos_cpufreq_upper_limit(
DVFS_LOCK_ID_USER, cpufreq_level); // DVFS_LOCK_ID_USER, cpufreq_level);
/* ret of exynos_cpufreq_upper_limit is meaningless. /* ret of exynos_cpufreq_upper_limit is meaningless.
0 is fail? success? */ 0 is fail? success? */
cpufreq_max_limit_val = val; cpufreq_max_limit_val = val;
Expand Down Expand Up @@ -514,19 +514,19 @@ static ssize_t cpufreq_min_limit_store(struct kobject *kobj,


if (val == -1) { /* Unlock request */ if (val == -1) { /* Unlock request */
if (cpufreq_min_limit_val != -1) { if (cpufreq_min_limit_val != -1) {
exynos_cpufreq_lock_free(DVFS_LOCK_ID_USER); // exynos_cpufreq_lock_free(DVFS_LOCK_ID_USER);
cpufreq_min_limit_val = -1; cpufreq_min_limit_val = -1;
} else /* Already unlocked */ } else /* Already unlocked */
printk(KERN_ERR "%s: Unlock request is ignored\n", printk(KERN_ERR "%s: Unlock request is ignored\n",
__func__); __func__);
} else { /* Lock request */ } else { /* Lock request */
if (get_cpufreq_level((unsigned int)val, &cpufreq_level) if (get_cpufreq_level((unsigned int)val, &cpufreq_level)
== VALID_LEVEL) { == VALID_LEVEL) {
if (cpufreq_min_limit_val != -1) // if (cpufreq_min_limit_val != -1)
/* Unlock the previous lock */ /* Unlock the previous lock */
exynos_cpufreq_lock_free(DVFS_LOCK_ID_USER); // exynos_cpufreq_lock_free(DVFS_LOCK_ID_USER);
lock_ret = exynos_cpufreq_lock( // lock_ret = exynos_cpufreq_lock(
DVFS_LOCK_ID_USER, cpufreq_level); // DVFS_LOCK_ID_USER, cpufreq_level);
/* ret of exynos_cpufreq_lock is meaningless. /* ret of exynos_cpufreq_lock is meaningless.
0 is fail? success? */ 0 is fail? success? */
cpufreq_min_limit_val = val; cpufreq_min_limit_val = val;
Expand Down

0 comments on commit 8c9ed69

Please sign in to comment.