diff options
author | Stratos Karafotis <stratosk@semaphore.gr> | 2014-07-18 11:37:26 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-21 07:43:19 -0400 |
commit | 4b707c893d0937be9c7be437950a312fbaf47601 (patch) | |
tree | 045d86341828bd89fc2a38391a6232c61add80ea | |
parent | ac658131d79e775efb0b819cc5a833e581d4de28 (diff) |
cpufreq: intel_pstate: Simplify P state adjustment logic.
Simplify the code by removing the inline functions pstate_increase and
pstate_decrease and use directly the intel_pstate_set_pstate.
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 129ffb2853dc..2ff85f665f93 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -530,21 +530,6 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) | |||
530 | pstate_funcs.set(cpu, pstate); | 530 | pstate_funcs.set(cpu, pstate); |
531 | } | 531 | } |
532 | 532 | ||
533 | static inline void intel_pstate_pstate_increase(struct cpudata *cpu, int steps) | ||
534 | { | ||
535 | int target; | ||
536 | target = cpu->pstate.current_pstate + steps; | ||
537 | |||
538 | intel_pstate_set_pstate(cpu, target); | ||
539 | } | ||
540 | |||
541 | static inline void intel_pstate_pstate_decrease(struct cpudata *cpu, int steps) | ||
542 | { | ||
543 | int target; | ||
544 | target = cpu->pstate.current_pstate - steps; | ||
545 | intel_pstate_set_pstate(cpu, target); | ||
546 | } | ||
547 | |||
548 | static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) | 533 | static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) |
549 | { | 534 | { |
550 | cpu->pstate.min_pstate = pstate_funcs.get_min(); | 535 | cpu->pstate.min_pstate = pstate_funcs.get_min(); |
@@ -632,20 +617,15 @@ static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu) | |||
632 | { | 617 | { |
633 | int32_t busy_scaled; | 618 | int32_t busy_scaled; |
634 | struct _pid *pid; | 619 | struct _pid *pid; |
635 | signed int ctl = 0; | 620 | signed int ctl; |
636 | int steps; | ||
637 | 621 | ||
638 | pid = &cpu->pid; | 622 | pid = &cpu->pid; |
639 | busy_scaled = intel_pstate_get_scaled_busy(cpu); | 623 | busy_scaled = intel_pstate_get_scaled_busy(cpu); |
640 | 624 | ||
641 | ctl = pid_calc(pid, busy_scaled); | 625 | ctl = pid_calc(pid, busy_scaled); |
642 | 626 | ||
643 | steps = abs(ctl); | 627 | /* Negative values of ctl increase the pstate and vice versa */ |
644 | 628 | intel_pstate_set_pstate(cpu, cpu->pstate.current_pstate - ctl); | |
645 | if (ctl < 0) | ||
646 | intel_pstate_pstate_increase(cpu, steps); | ||
647 | else | ||
648 | intel_pstate_pstate_decrease(cpu, steps); | ||
649 | } | 629 | } |
650 | 630 | ||
651 | static void intel_pstate_timer_func(unsigned long __data) | 631 | static void intel_pstate_timer_func(unsigned long __data) |