fanghuilin / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/cpufreq-nforce2.c linux-3.10.0-229.el7/drivers/cpufreq/cpufreq-nforce2.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/cpufreq-nforce2.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/cpufreq-nforce2.c	2015-03-09 09:22:18.376023945 -0400
c3024e
@@ -270,7 +270,7 @@
c3024e
 	pr_debug("Old CPU frequency %d kHz, new %d kHz\n",
c3024e
 	       freqs.old, freqs.new);
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	/* Disable IRQs */
c3024e
 	/* local_irq_save(flags); */
c3024e
@@ -285,7 +285,7 @@
c3024e
 	/* Enable IRQs */
c3024e
 	/* local_irq_restore(flags); */
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	return 0;
c3024e
 }
c3024e
Binary files linux-3.10.0-229.el7.original/drivers/cpufreq/.cpufreq-nforce2.c.swp and linux-3.10.0-229.el7/drivers/cpufreq/.cpufreq-nforce2.c.swp differ
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/exynos5440-cpufreq.c linux-3.10.0-229.el7/drivers/cpufreq/exynos5440-cpufreq.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/exynos5440-cpufreq.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/exynos5440-cpufreq.c	2015-03-09 09:22:18.377023945 -0400
c3024e
@@ -238,7 +238,7 @@
c3024e
 	freqs.old = dvfs_info->cur_frequency;
c3024e
 	freqs.new = freq_table[index].frequency;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	/* Set the target frequency in all C0_3_PSTATE register */
c3024e
 	for_each_cpu(i, policy->cpus) {
c3024e
@@ -279,7 +279,7 @@
c3024e
 		dev_crit(dvfs_info->dev, "New frequency out of range\n");
c3024e
 		freqs.new = dvfs_info->cur_frequency;
c3024e
 	}
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	cpufreq_cpu_put(policy);
c3024e
 	mutex_unlock(&cpufreq_lock);
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/gx-suspmod.c linux-3.10.0-229.el7/drivers/cpufreq/gx-suspmod.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/gx-suspmod.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/gx-suspmod.c	2015-03-09 09:22:18.377023945 -0400
c3024e
@@ -265,7 +265,7 @@
c3024e
 
c3024e
 	freqs.new = new_khz;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 	local_irq_save(flags);
c3024e
 
c3024e
 	if (new_khz != stock_freq) {
c3024e
@@ -314,7 +314,7 @@
c3024e
 
c3024e
 	gx_params->pci_suscfg = suscfg;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
c3024e
 		gx_params->on_duration * 32, gx_params->off_duration * 32);
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/integrator-cpufreq.c linux-3.10.0-229.el7/drivers/cpufreq/integrator-cpufreq.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/integrator-cpufreq.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/integrator-cpufreq.c	2015-03-09 09:22:18.377023945 -0400
c3024e
@@ -121,7 +121,7 @@
c3024e
 		return 0;
c3024e
 	}
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	cm_osc = __raw_readl(CM_OSC);
c3024e
 
c3024e
@@ -142,7 +142,7 @@
c3024e
 	 */
c3024e
 	set_cpus_allowed(current, cpus_allowed);
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	return 0;
c3024e
 }
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/longhaul.c linux-3.10.0-229.el7/drivers/cpufreq/longhaul.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/longhaul.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/longhaul.c	2015-03-09 09:22:18.377023945 -0400
c3024e
@@ -269,7 +269,7 @@
c3024e
 	freqs.old = calc_speed(longhaul_get_cpu_mult());
c3024e
 	freqs.new = speed;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
c3024e
 			fsb, mult/10, mult%10, print_speed(speed/1000));
c3024e
@@ -386,7 +386,7 @@
c3024e
 		}
c3024e
 	}
c3024e
 	/* Report true CPU frequency */
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	if (!bm_timeout)
c3024e
 		printk(KERN_INFO PFX "Warning: Timeout while waiting for "
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/powernow-k6.c linux-3.10.0-229.el7/drivers/cpufreq/powernow-k6.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/powernow-k6.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/powernow-k6.c	2015-03-09 09:23:09.182024898 -0400
c3024e
@@ -83,7 +83,7 @@
c3024e
 	freqs.old = busfreq * powernow_k6_get_cpu_multiplier();
c3024e
 	freqs.new = busfreq * clock_ratio[best_i].driver_data;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	/* we now need to transform best_i to the BVC format, see AMD#23446 */
c3024e
 
c3024e
@@ -98,7 +98,7 @@
c3024e
 	msrval = POWERNOW_IOPORT + 0x0;
c3024e
 	wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	return;
c3024e
 }
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/powernow-k7.c linux-3.10.0-229.el7/drivers/cpufreq/powernow-k7.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/powernow-k7.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/powernow-k7.c	2015-03-09 09:23:52.126025704 -0400
c3024e
@@ -269,7 +269,7 @@
c3024e
 
c3024e
 	freqs.new = powernow_table[index].frequency;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	/* Now do the magic poking into the MSRs.  */
c3024e
 
c3024e
@@ -290,7 +290,7 @@
c3024e
 	if (have_a0 == 1)
c3024e
 		local_irq_enable();
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 }
c3024e
 
c3024e
 
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/sh-cpufreq.c linux-3.10.0-229.el7/drivers/cpufreq/sh-cpufreq.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/sh-cpufreq.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/sh-cpufreq.c	2015-03-09 09:22:18.378023945 -0400
c3024e
@@ -68,10 +68,10 @@
c3024e
 	freqs.new	= (freq + 500) / 1000;
c3024e
 	freqs.flags	= 0;
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 	set_cpus_allowed_ptr(current, &cpus_allowed);
c3024e
 	clk_set_rate(cpuclk, freq);
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, 0);
c3024e
 
c3024e
 	dev_dbg(dev, "set frequency %lu Hz\n", freq);
c3024e
 
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-centrino.c linux-3.10.0-229.el7/drivers/cpufreq/speedstep-centrino.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-centrino.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/speedstep-centrino.c	2015-03-09 09:58:30.112064688 -0400
c3024e
@@ -345,7 +345,6 @@
c3024e
 	struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
c3024e
 	unsigned freq;
c3024e
 	unsigned l, h;
c3024e
-	int ret;
c3024e
 	int i;
c3024e
 
c3024e
 	/* Only Intel makes Enhanced Speedstep-capable CPUs */
c3024e
@@ -402,15 +401,8 @@
c3024e
 
c3024e
 	pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
c3024e
 
c3024e
-	ret = cpufreq_frequency_table_cpuinfo(policy,
c3024e
+	return cpufreq_table_validate_and_show(policy,
c3024e
 		per_cpu(centrino_model, policy->cpu)->op_points);
c3024e
-	if (ret)
c3024e
-		return (ret);
c3024e
-
c3024e
-	cpufreq_frequency_table_get_attr(
c3024e
-		per_cpu(centrino_model, policy->cpu)->op_points, policy->cpu);
c3024e
-
c3024e
-	return 0;
c3024e
 }
c3024e
 
c3024e
 static int centrino_cpu_exit(struct cpufreq_policy *policy)
c3024e
@@ -428,19 +420,6 @@
c3024e
 }
c3024e
 
c3024e
 /**
c3024e
- * centrino_verify - verifies a new CPUFreq policy
c3024e
- * @policy: new policy
c3024e
- *
c3024e
- * Limit must be within this model's frequency range at least one
c3024e
- * border included.
c3024e
- */
c3024e
-static int centrino_verify (struct cpufreq_policy *policy)
c3024e
-{
c3024e
-	return cpufreq_frequency_table_verify(policy,
c3024e
-			per_cpu(centrino_model, policy->cpu)->op_points);
c3024e
-}
c3024e
-
c3024e
-/**
c3024e
  * centrino_setpolicy - set a new CPUFreq policy
c3024e
  * @policy: new policy
c3024e
  * @target_freq: the target frequency
c3024e
@@ -561,20 +540,15 @@
c3024e
 	return retval;
c3024e
 }
c3024e
 
c3024e
-static struct freq_attr* centrino_attr[] = {
c3024e
-	&cpufreq_freq_attr_scaling_available_freqs,
c3024e
-	NULL,
c3024e
-};
c3024e
-
c3024e
 static struct cpufreq_driver centrino_driver = {
c3024e
 	.name		= "centrino", /* should be speedstep-centrino,
c3024e
 					 but there's a 16 char limit */
c3024e
 	.init		= centrino_cpu_init,
c3024e
 	.exit		= centrino_cpu_exit,
c3024e
-	.verify		= centrino_verify,
c3024e
+	.verify		= cpufreq_generic_frequency_table_verify,
c3024e
 	.target		= centrino_target,
c3024e
 	.get		= get_cur_freq,
c3024e
-	.attr           = centrino_attr,
c3024e
+	.attr		= cpufreq_generic_attr,
c3024e
 };
c3024e
 
c3024e
 /*
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-ich.c linux-3.10.0-229.el7/drivers/cpufreq/speedstep-ich.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-ich.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/speedstep-ich.c	2015-03-09 09:58:30.113064688 -0400
c3024e
@@ -289,18 +289,6 @@
c3024e
 }
c3024e
 
c3024e
 
c3024e
-/**
c3024e
- * speedstep_verify - verifies a new CPUFreq policy
c3024e
- * @policy: new policy
c3024e
- *
c3024e
- * Limit must be within speedstep_low_freq and speedstep_high_freq, with
c3024e
- * at least one border included.
c3024e
- */
c3024e
-static int speedstep_verify(struct cpufreq_policy *policy)
c3024e
-{
c3024e
-	return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);
c3024e
-}
c3024e
-
c3024e
 struct get_freqs {
c3024e
 	struct cpufreq_policy *policy;
c3024e
 	int ret;
c3024e
@@ -320,7 +308,6 @@
c3024e
 
c3024e
 static int speedstep_cpu_init(struct cpufreq_policy *policy)
c3024e
 {
c3024e
-	int result;
c3024e
 	unsigned int policy_cpu, speed;
c3024e
 	struct get_freqs gf;
c3024e
 
c3024e
@@ -349,36 +336,18 @@
c3024e
 	/* cpuinfo and default policy values */
c3024e
 	policy->cur = speed;
c3024e
 
c3024e
-	result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
c3024e
-	if (result)
c3024e
-		return result;
c3024e
-
c3024e
-	cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
c3024e
-
c3024e
-	return 0;
c3024e
+	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
c3024e
 }
c3024e
 
c3024e
 
c3024e
-static int speedstep_cpu_exit(struct cpufreq_policy *policy)
c3024e
-{
c3024e
-	cpufreq_frequency_table_put_attr(policy->cpu);
c3024e
-	return 0;
c3024e
-}
c3024e
-
c3024e
-static struct freq_attr *speedstep_attr[] = {
c3024e
-	&cpufreq_freq_attr_scaling_available_freqs,
c3024e
-	NULL,
c3024e
-};
c3024e
-
c3024e
-
c3024e
 static struct cpufreq_driver speedstep_driver = {
c3024e
 	.name	= "speedstep-ich",
c3024e
-	.verify	= speedstep_verify,
c3024e
+	.verify	= cpufreq_generic_frequency_table_verify,
c3024e
 	.target	= speedstep_target,
c3024e
 	.init	= speedstep_cpu_init,
c3024e
-	.exit	= speedstep_cpu_exit,
c3024e
+	.exit	= cpufreq_generic_exit,
c3024e
 	.get	= speedstep_get,
c3024e
-	.attr	= speedstep_attr,
c3024e
+	.attr	= cpufreq_generic_attr,
c3024e
 };
c3024e
 
c3024e
 static const struct x86_cpu_id ss_smi_ids[] = {
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-smi.c linux-3.10.0-229.el7/drivers/cpufreq/speedstep-smi.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/speedstep-smi.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/speedstep-smi.c	2015-03-09 09:58:30.113064688 -0400
c3024e
@@ -264,19 +264,6 @@
c3024e
 }
c3024e
 
c3024e
 
c3024e
-/**
c3024e
- * speedstep_verify - verifies a new CPUFreq policy
c3024e
- * @policy: new policy
c3024e
- *
c3024e
- * Limit must be within speedstep_low_freq and speedstep_high_freq, with
c3024e
- * at least one border included.
c3024e
- */
c3024e
-static int speedstep_verify(struct cpufreq_policy *policy)
c3024e
-{
c3024e
-	return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);
c3024e
-}
c3024e
-
c3024e
-
c3024e
 static int speedstep_cpu_init(struct cpufreq_policy *policy)
c3024e
 {
c3024e
 	int result;
c3024e
@@ -329,19 +316,7 @@
c3024e
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
c3024e
 	policy->cur = speed;
c3024e
 
c3024e
-	result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
c3024e
-	if (result)
c3024e
-		return result;
c3024e
-
c3024e
-	cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
c3024e
-
c3024e
-	return 0;
c3024e
-}
c3024e
-
c3024e
-static int speedstep_cpu_exit(struct cpufreq_policy *policy)
c3024e
-{
c3024e
-	cpufreq_frequency_table_put_attr(policy->cpu);
c3024e
-	return 0;
c3024e
+	return cpufreq_table_validate_and_show(policy, speedstep_freqs);
c3024e
 }
c3024e
 
c3024e
 static unsigned int speedstep_get(unsigned int cpu)
c3024e
@@ -362,20 +337,15 @@
c3024e
 	return result;
c3024e
 }
c3024e
 
c3024e
-static struct freq_attr *speedstep_attr[] = {
c3024e
-	&cpufreq_freq_attr_scaling_available_freqs,
c3024e
-	NULL,
c3024e
-};
c3024e
-
c3024e
 static struct cpufreq_driver speedstep_driver = {
c3024e
 	.name		= "speedstep-smi",
c3024e
-	.verify		= speedstep_verify,
c3024e
+	.verify		= cpufreq_generic_frequency_table_verify,
c3024e
 	.target		= speedstep_target,
c3024e
 	.init		= speedstep_cpu_init,
c3024e
-	.exit		= speedstep_cpu_exit,
c3024e
+	.exit		= cpufreq_generic_exit,
c3024e
 	.get		= speedstep_get,
c3024e
 	.resume		= speedstep_resume,
c3024e
-	.attr		= speedstep_attr,
c3024e
+	.attr		= cpufreq_generic_attr,
c3024e
 };
c3024e
 
c3024e
 static const struct x86_cpu_id ss_smi_ids[] = {
c3024e
diff -urN linux-3.10.0-229.el7.original/drivers/cpufreq/unicore2-cpufreq.c linux-3.10.0-229.el7/drivers/cpufreq/unicore2-cpufreq.c
c3024e
--- linux-3.10.0-229.el7.original/drivers/cpufreq/unicore2-cpufreq.c	2015-01-29 18:15:53.000000000 -0500
c3024e
+++ linux-3.10.0-229.el7/drivers/cpufreq/unicore2-cpufreq.c	2015-03-09 09:24:33.053026472 -0400
c3024e
@@ -50,14 +50,14 @@
c3024e
 	struct cpufreq_freqs freqs;
c3024e
 	struct clk *mclk = clk_get(NULL, "MAIN_CLK");
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
c3024e
+	cpufreq_freq_transition_begin(policy, &freqs);
c3024e
 
c3024e
 	if (!clk_set_rate(mclk, target_freq * 1000)) {
c3024e
 		freqs.old = cur;
c3024e
 		freqs.new = target_freq;
c3024e
 	}
c3024e
 
c3024e
-	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
c3024e
+	cpufreq_freq_transition_end(policy, &freqs, ret);
c3024e
 
c3024e
 	return 0;
c3024e
 }