jingni / rpms / kernel

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