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

Commit 7855e102 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge back earlier cpufreq material for v4.4.

parents 8e601a9f 4ef45148
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1546,6 +1546,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
		hwp_only
			Only load intel_pstate on systems which support
			hardware P state control (HWP) if available.
		no_acpi
			Don't use ACPI processor performance control objects
			_PSS and _PPC specified limits.

	intremap=	[X86-64, Intel-IOMMU]
			on	enable Interrupt Remapping (default)
+7 −0
Original line number Diff line number Diff line
@@ -206,6 +206,13 @@
#define MSR_GFX_PERF_LIMIT_REASONS	0x000006B0
#define MSR_RING_PERF_LIMIT_REASONS	0x000006B1

/* Config TDP MSRs */
#define MSR_CONFIG_TDP_NOMINAL		0x00000648
#define MSR_CONFIG_TDP_LEVEL1		0x00000649
#define MSR_CONFIG_TDP_LEVEL2		0x0000064A
#define MSR_CONFIG_TDP_CONTROL		0x0000064B
#define MSR_TURBO_ACTIVATION_RATIO	0x0000064C

/* Hardware P state interface */
#define MSR_PPERF			0x0000064e
#define MSR_PERF_LIMIT_REASONS		0x0000064f
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
config X86_INTEL_PSTATE
       bool "Intel P state control"
       depends on X86
       select ACPI_PROCESSOR if ACPI
       help
          This driver provides a P state for Intel core processors.
	  The driver implements an internal governor and will become
+0 −7
Original line number Diff line number Diff line
@@ -843,18 +843,11 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,

	down_write(&policy->rwsem);

	/* Updating inactive policies is invalid, so avoid doing that. */
	if (unlikely(policy_is_inactive(policy))) {
		ret = -EBUSY;
		goto unlock_policy_rwsem;
	}

	if (fattr->store)
		ret = fattr->store(policy, buf, count);
	else
		ret = -EIO;

unlock_policy_rwsem:
	up_write(&policy->rwsem);
unlock:
	put_online_cpus();
+18 −13
Original line number Diff line number Diff line
@@ -23,6 +23,19 @@

static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info);

static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
				   unsigned int event);

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

static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners,
					   struct cpufreq_policy *policy)
{
@@ -119,12 +132,14 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
	struct cpufreq_freqs *freq = data;
	struct cs_cpu_dbs_info_s *dbs_info =
					&per_cpu(cs_cpu_dbs_info, freq->cpu);
	struct cpufreq_policy *policy;
	struct cpufreq_policy *policy = cpufreq_cpu_get_raw(freq->cpu);

	if (!dbs_info->enable)
	if (!policy)
		return 0;

	policy = dbs_info->cdbs.shared->policy;
	/* policy isn't governed by conservative governor */
	if (policy->governor != &cpufreq_gov_conservative)
		return 0;

	/*
	 * we only care if our internally tracked freq moves outside the 'valid'
@@ -367,16 +382,6 @@ static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
	return cpufreq_governor_dbs(policy, &cs_dbs_cdata, event);
}

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

static int __init cpufreq_gov_dbs_init(void)
{
	return cpufreq_register_governor(&cpufreq_gov_conservative);
Loading