Skip to content

Commit

Permalink
Changes in PM to always respect cpufreq policy limits
Browse files Browse the repository at this point in the history
  • Loading branch information
XDA Bam committed Feb 6, 2012
1 parent ac58068 commit 964843e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Kernel/arch/arm/plat-omap/omap-pm.c
Expand Up @@ -852,10 +852,24 @@ int omap_pm_set_min_mpu_freq(struct device *dev, unsigned long f)
/* Save the current constraint */
old_max_level = mpu_tput->max_level;

if (f == -1)
if (f == -1) {
remove_req_tput(dev, mpu_tput);
else
} else {
struct cpufreq_policy policy;

cpufreq_get_policy(&policy, 0);

/*
* Ensure that this request is not conflicting with cpufreq
* constraints. If that is the case, cpufreq wins.
*/
if ((f/1000) < policy.min)
f = policy.min * 1000;
if ((f/1000) > policy.max)
f = policy.max * 1000;

add_req_tput(dev, f, mpu_tput);
}

/* Find max constraint after the operation */
max_lookup(mpu_tput);
Expand Down

1 comment on commit 964843e

@XDA-Bam
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.