Skip to content

Commit

Permalink
Merge branch 'pm-fixes'
Browse files Browse the repository at this point in the history
* pm-fixes:
  cpufreq: Fix serialization of frequency transitions
  • Loading branch information
Rafael J. Wysocki committed Jul 8, 2013
2 parents f991fae + 266c13d commit 85a229f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,12 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
switch (state) {

case CPUFREQ_PRECHANGE:
if (WARN(policy->transition_ongoing,
if (WARN(policy->transition_ongoing ==
cpumask_weight(policy->cpus),
"In middle of another frequency transition\n"))
return;

policy->transition_ongoing = true;
policy->transition_ongoing++;

/* detect if the driver reported a value as "old frequency"
* which is not equal to what the cpufreq core thinks is
Expand All @@ -341,7 +342,7 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
"No frequency transition in progress\n"))
return;

policy->transition_ongoing = false;
policy->transition_ongoing--;

adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
Expand Down
2 changes: 1 addition & 1 deletion include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct cpufreq_policy {

struct kobject kobj;
struct completion kobj_unregister;
bool transition_ongoing; /* Tracks transition status */
int transition_ongoing; /* Tracks transition status */
};

#define CPUFREQ_ADJUST (0)
Expand Down

0 comments on commit 85a229f

Please sign in to comment.