Skip to content

Commit 4650b27

Browse files
committed
Merge branches 'pm-cpuidle' and 'pm-cpufreq'
* pm-cpuidle: cpuidle: governor: Add new governors to cpuidle_governors again cpuidle: menu: Avoid overflows when computing variance * pm-cpufreq: cpufreq: intel_pstate: Fix up iowait_boost computation cpufreq: pxa2xx: remove incorrect __init annotation cpufreq: Improve kerneldoc comments for cpufreq_cpu_get/put()
3 parents e603525 + 22782b3 + 8e3b403 commit 4650b27

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,15 @@ unsigned int cpufreq_generic_get(unsigned int cpu)
206206
EXPORT_SYMBOL_GPL(cpufreq_generic_get);
207207

208208
/**
209-
* cpufreq_cpu_get: returns policy for a cpu and marks it busy.
209+
* cpufreq_cpu_get - Return policy for a CPU and mark it as busy.
210+
* @cpu: CPU to find the policy for.
210211
*
211-
* @cpu: cpu to find policy for.
212+
* Call cpufreq_cpu_get_raw() to obtain a cpufreq policy for @cpu and increment
213+
* the kobject reference counter of that policy. Return a valid policy on
214+
* success or NULL on failure.
212215
*
213-
* This returns policy for 'cpu', returns NULL if it doesn't exist.
214-
* It also increments the kobject reference count to mark it busy and so would
215-
* require a corresponding call to cpufreq_cpu_put() to decrement it back.
216-
* If corresponding call cpufreq_cpu_put() isn't made, the policy wouldn't be
217-
* freed as that depends on the kobj count.
218-
*
219-
* Return: A valid policy on success, otherwise NULL on failure.
216+
* The policy returned by this function has to be released with the help of
217+
* cpufreq_cpu_put() to balance its kobject reference counter properly.
220218
*/
221219
struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
222220
{
@@ -243,12 +241,8 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
243241
EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
244242

245243
/**
246-
* cpufreq_cpu_put: Decrements the usage count of a policy
247-
*
248-
* @policy: policy earlier returned by cpufreq_cpu_get().
249-
*
250-
* This decrements the kobject reference count incremented earlier by calling
251-
* cpufreq_cpu_get().
244+
* cpufreq_cpu_put - Decrement kobject usage counter for cpufreq policy.
245+
* @policy: cpufreq policy returned by cpufreq_cpu_get().
252246
*/
253247
void cpufreq_cpu_put(struct cpufreq_policy *policy)
254248
{

drivers/cpufreq/intel_pstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,7 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time,
17621762
/* Start over if the CPU may have been idle. */
17631763
if (delta_ns > TICK_NSEC) {
17641764
cpu->iowait_boost = ONE_EIGHTH_FP;
1765-
} else if (cpu->iowait_boost) {
1765+
} else if (cpu->iowait_boost >= ONE_EIGHTH_FP) {
17661766
cpu->iowait_boost <<= 1;
17671767
if (cpu->iowait_boost > int_tofp(1))
17681768
cpu->iowait_boost = int_tofp(1);

drivers/cpufreq/pxa2xx-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq)
143143
return ret;
144144
}
145145

146-
static void __init pxa_cpufreq_init_voltages(void)
146+
static void pxa_cpufreq_init_voltages(void)
147147
{
148148
vcc_core = regulator_get(NULL, "vcc_core");
149149
if (IS_ERR(vcc_core)) {
@@ -159,7 +159,7 @@ static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq)
159159
return 0;
160160
}
161161

162-
static void __init pxa_cpufreq_init_voltages(void) { }
162+
static void pxa_cpufreq_init_voltages(void) { }
163163
#endif
164164

165165
static void find_freq_tables(struct cpufreq_frequency_table **freq_table,

drivers/cpuidle/governor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
8989
mutex_lock(&cpuidle_lock);
9090
if (__cpuidle_find_governor(gov->name) == NULL) {
9191
ret = 0;
92+
list_add_tail(&gov->governor_list, &cpuidle_governors);
9293
if (!cpuidle_curr_governor ||
9394
!strncasecmp(param_governor, gov->name, CPUIDLE_NAME_LEN) ||
9495
(cpuidle_curr_governor->rating < gov->rating &&

drivers/cpuidle/governors/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static unsigned int get_typical_interval(struct menu_device *data,
186186
unsigned int min, max, thresh, avg;
187187
uint64_t sum, variance;
188188

189-
thresh = UINT_MAX; /* Discard outliers above this value */
189+
thresh = INT_MAX; /* Discard outliers above this value */
190190

191191
again:
192192

0 commit comments

Comments
 (0)