Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm+acpi-3.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from
"These fix two bugs in the intel_pstate driver, a hibernate bug leading
to nasty resume failures sometimes and acpi-cpufreq initialization bug
that causes problems to happen during module unload when intel_pstate
is in use.

Specifics:

- Fix for rounding errors in intel_pstate causing CPU utilization to
be underestimated from Brennan Shacklett.

- intel_pstate fix to always use the correct max pstate value when
computing the min pstate from Dirk Brandewie.

- Hibernation fix for deadlocking resume in cases when the probing of
the device containing the image is deferred from Russ Dill.

- acpi-cpufreq fix to prevent the module from staying in memory when
the driver cannot be registered and then attempting to unregister
things that have never been registered on exit"

* tag 'pm+acpi-3.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
acpi-cpufreq: Fail initialization if driver cannot be registered
PM / hibernate: Move software_resume to late_initcall_sync
intel_pstate: Correct calculation of min pstate value
intel_pstate: Improve accuracy by not truncating until final result

+23 -25
+4 -4
drivers/cpufreq/acpi-cpufreq.c
··· 986 986 { 987 987 int ret; 988 988 989 + if (acpi_disabled) 990 + return -ENODEV; 991 + 989 992 /* don't keep reloading if cpufreq_driver exists */ 990 993 if (cpufreq_get_current_driver()) 991 - return 0; 992 - 993 - if (acpi_disabled) 994 - return 0; 994 + return -EEXIST; 995 995 996 996 pr_debug("acpi_cpufreq_init\n"); 997 997
+18 -20
drivers/cpufreq/intel_pstate.c
··· 48 48 } 49 49 50 50 struct sample { 51 - int core_pct_busy; 51 + int32_t core_pct_busy; 52 52 u64 aperf; 53 53 u64 mperf; 54 54 int freq; ··· 68 68 int32_t i_gain; 69 69 int32_t d_gain; 70 70 int deadband; 71 - int last_err; 71 + int32_t last_err; 72 72 }; 73 73 74 74 struct cpudata { ··· 153 153 pid->d_gain = div_fp(int_tofp(percent), int_tofp(100)); 154 154 } 155 155 156 - static signed int pid_calc(struct _pid *pid, int busy) 156 + static signed int pid_calc(struct _pid *pid, int32_t busy) 157 157 { 158 - signed int err, result; 158 + signed int result; 159 159 int32_t pterm, dterm, fp_error; 160 160 int32_t integral_limit; 161 161 162 - err = pid->setpoint - busy; 163 - fp_error = int_tofp(err); 162 + fp_error = int_tofp(pid->setpoint) - busy; 164 163 165 - if (abs(err) <= pid->deadband) 164 + if (abs(fp_error) <= int_tofp(pid->deadband)) 166 165 return 0; 167 166 168 167 pterm = mul_fp(pid->p_gain, fp_error); ··· 175 176 if (pid->integral < -integral_limit) 176 177 pid->integral = -integral_limit; 177 178 178 - dterm = mul_fp(pid->d_gain, (err - pid->last_err)); 179 - pid->last_err = err; 179 + dterm = mul_fp(pid->d_gain, fp_error - pid->last_err); 180 + pid->last_err = fp_error; 180 181 181 182 result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; 182 183 ··· 366 367 static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) 367 368 { 368 369 int max_perf = cpu->pstate.turbo_pstate; 370 + int max_perf_adj; 369 371 int min_perf; 370 372 if (limits.no_turbo) 371 373 max_perf = cpu->pstate.max_pstate; 372 374 373 - max_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf)); 374 - *max = clamp_t(int, max_perf, 375 + max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf)); 376 + *max = clamp_t(int, max_perf_adj, 375 377 cpu->pstate.min_pstate, cpu->pstate.turbo_pstate); 376 378 377 379 min_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.min_perf)); ··· 436 436 struct sample *sample) 437 437 { 438 438 u64 core_pct; 439 - core_pct = div64_u64(sample->aperf * 100, sample->mperf); 440 - sample->freq = cpu->pstate.max_pstate * core_pct * 1000; 439 + core_pct = div64_u64(int_tofp(sample->aperf * 100), 440 + sample->mperf); 441 + sample->freq = fp_toint(cpu->pstate.max_pstate * core_pct * 1000); 441 442 442 443 sample->core_pct_busy = core_pct; 443 444 } ··· 470 469 mod_timer_pinned(&cpu->timer, jiffies + delay); 471 470 } 472 471 473 - static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu) 472 + static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu) 474 473 { 475 - int32_t busy_scaled; 476 474 int32_t core_busy, max_pstate, current_pstate; 477 475 478 - core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy); 476 + core_busy = cpu->samples[cpu->sample_ptr].core_pct_busy; 479 477 max_pstate = int_tofp(cpu->pstate.max_pstate); 480 478 current_pstate = int_tofp(cpu->pstate.current_pstate); 481 - busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); 482 - 483 - return fp_toint(busy_scaled); 479 + return mul_fp(core_busy, div_fp(max_pstate, current_pstate)); 484 480 } 485 481 486 482 static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu) 487 483 { 488 - int busy_scaled; 484 + int32_t busy_scaled; 489 485 struct _pid *pid; 490 486 signed int ctl = 0; 491 487 int steps;
+1 -1
kernel/power/hibernate.c
··· 846 846 goto Finish; 847 847 } 848 848 849 - late_initcall(software_resume); 849 + late_initcall_sync(software_resume); 850 850 851 851 852 852 static const char * const hibernation_modes[] = {