diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 11:13:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 11:13:36 -0700 |
commit | 8d91530c5fd7f0b1e8c4ddfea2905e55a178569b (patch) | |
tree | f211c693c00015d9f5d015dc162fffa676629d1c /drivers | |
parent | c145307a110c14d09d5d92ff3c49dc0940e44b80 (diff) | |
parent | 9d1f44ee206a23b975d7d7c6f759efb25e0e61ac (diff) | |
download | op-kernel-dev-8d91530c5fd7f0b1e8c4ddfea2905e55a178569b.zip op-kernel-dev-8d91530c5fd7f0b1e8c4ddfea2905e55a178569b.tar.gz |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] Remove pointless printk from p4-clockmod.
[CPUFREQ] Fix section mismatch for powernow_cpu_init in powernow-k7.c
[CPUFREQ] Fix section mismatch for longhaul_cpu_init.
[CPUFREQ] Fix section mismatch for longrun_cpu_init.
[CPUFREQ] powernow-k8: Fix misleading variable naming
[CPUFREQ] Convert pci_table entries to PCI_VDEVICE (if PCI_ANY_ID is used)
[CPUFREQ] arch/x86/kernel/cpu/cpufreq: use for_each_pci_dev()
[CPUFREQ] fix brace coding style issue.
[CPUFREQ] x86 cpufreq: Make trace_power_frequency cpufreq driver independent
[CPUFREQ] acpi-cpufreq: Fix CPU_ANY CPUFREQ_{PRE,POST}CHANGE notification
[CPUFREQ] ondemand: don't synchronize sample rate unless multiple cpus present
[CPUFREQ] unexport (un)lock_policy_rwsem* functions
[CPUFREQ] ondemand: Refactor frequency increase code
[CPUFREQ] powernow-k8: On load failure, remind the user to enable support in BIOS setup
[CPUFREQ] powernow-k8: Limit Pstate transition latency check
[CPUFREQ] Fix PCC driver error path
[CPUFREQ] fix double freeing in error path of pcc-cpufreq
[CPUFREQ] pcc driver should check for pcch method before calling _OSC
[CPUFREQ] fix memory leak in cpufreq_add_dev
[CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"
Manually fix up non-data merge conflict introduced by new calling
conventions for trace_power_start() in commit 6f4f2723d085 ("x86
cpufreq: Make trace_power_frequency cpufreq driver independent"), which
didn't update the intel_idle native hardware cpuidle driver.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 18 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 33 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 2 | ||||
-rwxr-xr-x | drivers/idle/intel_idle.c | 2 |
4 files changed, 29 insertions, 26 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 938b74e..199dcb9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -29,6 +29,8 @@ #include <linux/completion.h> #include <linux/mutex.h> +#include <trace/events/power.h> + #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \ "cpufreq-core", msg) @@ -68,7 +70,7 @@ static DEFINE_PER_CPU(int, cpufreq_policy_cpu); static DEFINE_PER_CPU(struct rw_semaphore, cpu_policy_rwsem); #define lock_policy_rwsem(mode, cpu) \ -int lock_policy_rwsem_##mode \ +static int lock_policy_rwsem_##mode \ (int cpu) \ { \ int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); \ @@ -83,26 +85,22 @@ int lock_policy_rwsem_##mode \ } lock_policy_rwsem(read, cpu); -EXPORT_SYMBOL_GPL(lock_policy_rwsem_read); lock_policy_rwsem(write, cpu); -EXPORT_SYMBOL_GPL(lock_policy_rwsem_write); -void unlock_policy_rwsem_read(int cpu) +static void unlock_policy_rwsem_read(int cpu) { int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); BUG_ON(policy_cpu == -1); up_read(&per_cpu(cpu_policy_rwsem, policy_cpu)); } -EXPORT_SYMBOL_GPL(unlock_policy_rwsem_read); -void unlock_policy_rwsem_write(int cpu) +static void unlock_policy_rwsem_write(int cpu) { int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); BUG_ON(policy_cpu == -1); up_write(&per_cpu(cpu_policy_rwsem, policy_cpu)); } -EXPORT_SYMBOL_GPL(unlock_policy_rwsem_write); /* internal prototypes */ @@ -354,6 +352,9 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) case CPUFREQ_POSTCHANGE: adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); + dprintk("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, + (unsigned long)freqs->cpu); + trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu); srcu_notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs); if (likely(policy) && likely(policy->cpu == freqs->cpu)) @@ -1875,8 +1876,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_block __refdata cpufreq_cpu_notifier = -{ +static struct notifier_block __refdata cpufreq_cpu_notifier = { .notifier_call = cpufreq_cpu_callback, }; diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index e131421..7b5093664 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -459,6 +459,17 @@ static struct attribute_group dbs_attr_group_old = { /************************** sysfs end ************************/ +static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq) +{ + if (dbs_tuners_ins.powersave_bias) + freq = powersave_bias_target(p, freq, CPUFREQ_RELATION_H); + else if (p->cur == p->max) + return; + + __cpufreq_driver_target(p, freq, dbs_tuners_ins.powersave_bias ? + CPUFREQ_RELATION_L : CPUFREQ_RELATION_H); +} + static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) { unsigned int max_load_freq; @@ -551,19 +562,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) /* Check for frequency increase */ if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) { - /* if we are already at full speed then break out early */ - if (!dbs_tuners_ins.powersave_bias) { - if (policy->cur == policy->max) - return; - - __cpufreq_driver_target(policy, policy->max, - CPUFREQ_RELATION_H); - } else { - int freq = powersave_bias_target(policy, policy->max, - CPUFREQ_RELATION_H); - __cpufreq_driver_target(policy, freq, - CPUFREQ_RELATION_L); - } + dbs_freq_increase(policy, policy->max); return; } @@ -610,7 +609,9 @@ static void do_dbs_timer(struct work_struct *work) /* We want all CPUs to do sampling nearly on same jiffy */ int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); - delay -= jiffies % delay; + if (num_online_cpus() > 1) + delay -= jiffies % delay; + mutex_lock(&dbs_info->timer_mutex); /* Common NORMAL_SAMPLE setup */ @@ -635,7 +636,9 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) { /* We want all CPUs to do sampling nearly on same jiffy */ int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); - delay -= jiffies % delay; + + if (num_online_cpus() > 1) + delay -= jiffies % delay; dbs_info->sample_type = DBS_NORMAL_SAMPLE; INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 1994885..dbefe15 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -95,7 +95,7 @@ static void cpuidle_idle_call(void) /* give the governor an opportunity to reflect on the outcome */ if (cpuidle_curr_governor->reflect) cpuidle_curr_governor->reflect(dev); - trace_power_end(0); + trace_power_end(smp_processor_id()); } /** diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 54f0fb4..03d202b 100755 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -231,7 +231,7 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) stop_critical_timings(); #ifndef MODULE - trace_power_start(POWER_CSTATE, (eax >> 4) + 1); + trace_power_start(POWER_CSTATE, (eax >> 4) + 1, cpu); #endif if (!need_resched()) { |