diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-08 15:49:25 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-08 15:49:25 -0400 |
commit | 85a229f4c729c4de48ba241f77e447c36bbc07f7 (patch) | |
tree | 924a27434d5846f69b541012494d6ea1f2cb10cf | |
parent | f991fae5c6d42dfc5029150b05a78cf3f6c18cc9 (diff) | |
parent | 266c13d767be61a17d8e6f2310b9b7c46278273b (diff) |
Merge branch 'pm-fixes'
* pm-fixes:
cpufreq: Fix serialization of frequency transitions
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6a015ada5285..0937b8d6c2a4 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -312,11 +312,12 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, | |||
312 | switch (state) { | 312 | switch (state) { |
313 | 313 | ||
314 | case CPUFREQ_PRECHANGE: | 314 | case CPUFREQ_PRECHANGE: |
315 | if (WARN(policy->transition_ongoing, | 315 | if (WARN(policy->transition_ongoing == |
316 | cpumask_weight(policy->cpus), | ||
316 | "In middle of another frequency transition\n")) | 317 | "In middle of another frequency transition\n")) |
317 | return; | 318 | return; |
318 | 319 | ||
319 | policy->transition_ongoing = true; | 320 | policy->transition_ongoing++; |
320 | 321 | ||
321 | /* detect if the driver reported a value as "old frequency" | 322 | /* detect if the driver reported a value as "old frequency" |
322 | * which is not equal to what the cpufreq core thinks is | 323 | * which is not equal to what the cpufreq core thinks is |
@@ -341,7 +342,7 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, | |||
341 | "No frequency transition in progress\n")) | 342 | "No frequency transition in progress\n")) |
342 | return; | 343 | return; |
343 | 344 | ||
344 | policy->transition_ongoing = false; | 345 | policy->transition_ongoing--; |
345 | 346 | ||
346 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); | 347 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); |
347 | pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, | 348 | pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4d7390bc1727..90d5a15120d5 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -119,7 +119,7 @@ struct cpufreq_policy { | |||
119 | 119 | ||
120 | struct kobject kobj; | 120 | struct kobject kobj; |
121 | struct completion kobj_unregister; | 121 | struct completion kobj_unregister; |
122 | bool transition_ongoing; /* Tracks transition status */ | 122 | int transition_ongoing; /* Tracks transition status */ |
123 | }; | 123 | }; |
124 | 124 | ||
125 | #define CPUFREQ_ADJUST (0) | 125 | #define CPUFREQ_ADJUST (0) |