Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 098ef215 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Fix BUG: using smp_processor_id() in preemptible code
  [CPUFREQ] Don't export governors for default governor
  [CPUFREQ][6/6] cpufreq: Add idle microaccounting in ondemand governor
  [CPUFREQ][5/6] cpufreq: Changes to get_cpu_idle_time_us(), used by ondemand governor
  [CPUFREQ][4/6] cpufreq_ondemand: Parameterize down differential
  [CPUFREQ][3/6] cpufreq: get_cpu_idle_time() changes in ondemand for idle-microaccounting
  [CPUFREQ][2/6] cpufreq: Change load calculation in ondemand for software coordination
  [CPUFREQ][1/6] cpufreq: Add cpu number parameter to __cpufreq_driver_getavg()
  [CPUFREQ] use deferrable delayed work init in conservative governor
  [CPUFREQ] drivers/cpufreq/cpufreq.c: Adjust error handling code involving cpufreq_cpu_put
  [CPUFREQ] add error handling for cpufreq_register_governor() error
  [CPUFREQ] acpi-cpufreq: add error handling for cpufreq_register_driver() error
  [CPUFREQ] Coding style fixes to arch/x86/kernel/cpu/cpufreq/powernow-k6.c
  [CPUFREQ] Coding style fixes to arch/x86/kernel/cpu/cpufreq/elanfreq.c
parents b922df73 4f6e6b9f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -256,7 +256,8 @@ static u32 get_cur_val(const cpumask_t *mask)
 * Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
 * no meaning should be associated with absolute values of these MSRs.
 */
static unsigned int get_measured_perf(unsigned int cpu)
static unsigned int get_measured_perf(struct cpufreq_policy *policy,
				      unsigned int cpu)
{
	union {
		struct {
@@ -326,7 +327,7 @@ static unsigned int get_measured_perf(unsigned int cpu)

#endif

	retval = per_cpu(drv_data, cpu)->max_freq * perf_percent / 100;
	retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100;

	put_cpu();
	set_cpus_allowed_ptr(current, &saved_mask);
@@ -785,7 +786,11 @@ static int __init acpi_cpufreq_init(void)
	if (ret)
		return ret;

	return cpufreq_register_driver(&acpi_cpufreq_driver);
	ret = cpufreq_register_driver(&acpi_cpufreq_driver);
	if (ret)
		free_percpu(acpi_perf_data);

	return ret;
}

static void __exit acpi_cpufreq_exit(void)
@@ -795,8 +800,6 @@ static void __exit acpi_cpufreq_exit(void)
	cpufreq_unregister_driver(&acpi_cpufreq_driver);

	free_percpu(acpi_perf_data);

	return;
}

module_param(acpi_pstate_strict, uint, 0644);
+21 −21
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@
#include <linux/cpufreq.h>

#include <asm/msr.h>
#include <asm/timex.h>
#include <asm/io.h>
#include <linux/timex.h>
#include <linux/io.h>

#define REG_CSCIR 0x22		/* Chip Setup and Control Index Register    */
#define REG_CSCDR 0x23		/* Chip Setup and Control Data  Register    */
@@ -101,7 +101,7 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
	if ((clockspeed_reg & 0xE0) == 0xA0)
		return 33000;

	return ((1<<((clockspeed_reg & 0xE0) >> 5)) * 1000);
	return (1<<((clockspeed_reg & 0xE0) >> 5)) * 1000;
}


@@ -224,7 +224,7 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)

	result = cpufreq_frequency_table_cpuinfo(policy, elanfreq_table);
	if (result)
		return (result);
		return result;

	cpufreq_frequency_table_get_attr(elanfreq_table, policy->cpu);
	return 0;
+20 −21
Original line number Diff line number Diff line
@@ -15,9 +15,8 @@
#include <linux/slab.h>

#include <asm/msr.h>
#include <asm/timex.h>
#include <asm/io.h>

#include <linux/timex.h>
#include <linux/io.h>

#define POWERNOW_IOPORT 0xfff0          /* it doesn't matter where, as long
					   as it is unused */
@@ -165,7 +164,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)

	result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio);
	if (result)
		return (result);
		return result;

	cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu);

+19 −11
Original line number Diff line number Diff line
@@ -1467,25 +1467,27 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
			  unsigned int target_freq,
			  unsigned int relation)
{
	int ret;
	int ret = -EINVAL;

	policy = cpufreq_cpu_get(policy->cpu);
	if (!policy)
		return -EINVAL;
		goto no_policy;

	if (unlikely(lock_policy_rwsem_write(policy->cpu)))
		return -EINVAL;
		goto fail;

	ret = __cpufreq_driver_target(policy, target_freq, relation);

	unlock_policy_rwsem_write(policy->cpu);

fail:
	cpufreq_cpu_put(policy);
no_policy:
	return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_target);

int __cpufreq_driver_getavg(struct cpufreq_policy *policy)
int __cpufreq_driver_getavg(struct cpufreq_policy *policy, unsigned int cpu)
{
	int ret = 0;

@@ -1493,8 +1495,8 @@ int __cpufreq_driver_getavg(struct cpufreq_policy *policy)
	if (!policy)
		return -EINVAL;

	if (cpu_online(policy->cpu) && cpufreq_driver->getavg)
		ret = cpufreq_driver->getavg(policy->cpu);
	if (cpu_online(cpu) && cpufreq_driver->getavg)
		ret = cpufreq_driver->getavg(policy, cpu);

	cpufreq_cpu_put(policy);
	return ret;
@@ -1717,13 +1719,17 @@ int cpufreq_update_policy(unsigned int cpu)
{
	struct cpufreq_policy *data = cpufreq_cpu_get(cpu);
	struct cpufreq_policy policy;
	int ret = 0;
	int ret;

	if (!data)
		return -ENODEV;
	if (!data) {
		ret = -ENODEV;
		goto no_policy;
	}

	if (unlikely(lock_policy_rwsem_write(cpu)))
		return -EINVAL;
	if (unlikely(lock_policy_rwsem_write(cpu))) {
		ret = -EINVAL;
		goto fail;
	}

	dprintk("updating policy for CPU %u\n", cpu);
	memcpy(&policy, data, sizeof(struct cpufreq_policy));
@@ -1750,7 +1756,9 @@ int cpufreq_update_policy(unsigned int cpu)

	unlock_policy_rwsem_write(cpu);

fail:
	cpufreq_cpu_put(data);
no_policy:
	return ret;
}
EXPORT_SYMBOL(cpufreq_update_policy);
+4 −1
Original line number Diff line number Diff line
@@ -460,6 +460,7 @@ static void do_dbs_timer(struct work_struct *work)

static inline void dbs_timer_init(void)
{
	init_timer_deferrable(&dbs_work.timer);
	schedule_delayed_work(&dbs_work,
			usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
	return;
@@ -575,13 +576,15 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
	return 0;
}

#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
static
#endif
struct cpufreq_governor cpufreq_gov_conservative = {
	.name			= "conservative",
	.governor		= cpufreq_governor_dbs,
	.max_transition_latency	= TRANSITION_LATENCY_LIMIT,
	.owner			= THIS_MODULE,
};
EXPORT_SYMBOL(cpufreq_gov_conservative);

static int __init cpufreq_gov_dbs_init(void)
{
Loading