All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][1/2] Clarify cpu_family statements
@ 2006-06-08 15:30 Langsdorf, Mark
  2006-06-20  5:47 ` Dave Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Langsdorf, Mark @ 2006-06-08 15:30 UTC (permalink / raw)
  To: cpufreq

[-- Attachment #1: Type: text/plain, Size: 4127 bytes --]

This patch clarfies the meaning of the cpu_family if
statements in the hw pstate driver patch for powernow-k8

-Mark Langsdorf
AMD, Inc.

(inline and attached because my mailer is very braindead)
signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

--- linux-mm6-2.6.17/arch/i386/kernel/cpu/cpufreq/powernow-k8.c.orig
2006-06-08 09:44:17.000000000 -0500
+++ linux-mm6-2.6.17/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
2006-06-08 09:58:01.000000000 -0500
@@ -120,7 +120,7 @@ static int pending_bit_stuck(void)
 {
 	u32 lo, hi;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		return 0;
 
 	rdmsr(MSR_FIDVID_STATUS, lo, hi);
@@ -136,7 +136,7 @@ static int query_current_values_with_pen
 	u32 lo, hi;
 	u32 i = 0;
 
-	if (cpu_family) {
+	if (cpu_family == CPU_HW_PSTATE) {
 		rdmsr(MSR_PSTATE_STATUS, lo, hi);
 		i = lo & HW_PSTATE_MASK;
 		rdmsr(MSR_PSTATE_DEF_BASE + i, lo, hi);
@@ -598,7 +598,7 @@ static void print_basics(struct powernow
 	int j;
 	for (j = 0; j < data->numps; j++) {
 		if (data->powernow_table[j].frequency !=
CPUFREQ_ENTRY_INVALID) {
-			if (cpu_family) {
+			if (cpu_family == CPU_HW_PSTATE) {
 			printk(KERN_INFO PFX "   %d : fid 0x%x gid 0x%x
(%d MHz)\n", j, (data->powernow_table[j].index & 0xff00) >> 8,
 				(data->powernow_table[j].index &
0xff0000) >> 16,
 				data->powernow_table[j].frequency/1000);
@@ -758,7 +758,7 @@ static int find_psb_table(struct powerno
 #ifdef CONFIG_X86_POWERNOW_K8_ACPI
 static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data,
unsigned int index)
 {
-	if (!data->acpi_data.state_count || cpu_family)
+	if (!data->acpi_data.state_count || (cpu_family ==
CPU_HW_PSTATE))
 		return;
 
 	data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT)
& IRT_MASK;
@@ -801,7 +801,7 @@ static int powernow_k8_cpu_init_acpi(str
 		goto err_out;
 	}
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		ret_val = fill_powernow_table_pstate(data,
powernow_table);
 	else
 		ret_val = fill_powernow_table_fidvid(data,
powernow_table);
@@ -1082,7 +1082,7 @@ static int powernowk8_target(struct cpuf
 	if (query_current_values_with_pending_wait(data))
 		goto err_out;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		dprintk("targ: curr fid 0x%x, did 0x%x\n",
 			data->currfid, data->currvid);
 	else {
@@ -1103,7 +1103,7 @@ static int powernowk8_target(struct cpuf
 
 	powernow_k8_acpi_pst_values(data, newstate);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		ret = transition_frequency_pstate(data, newstate);
 	else
 		ret = transition_frequency_fidvid(data, newstate);
@@ -1115,7 +1115,7 @@ static int powernowk8_target(struct cpuf
 	}
 	mutex_unlock(&fidvid_mutex);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cur = find_khz_freq_from_fiddid(data->currfid,
data->currdid);
 	else
 		pol->cur = find_khz_freq_from_fid(data->currfid);
@@ -1197,14 +1197,14 @@ static int __cpuinit powernowk8_cpu_init
 	if (query_current_values_with_pending_wait(data))
 		goto err_out;
 
-	if (!cpu_family)
+	if (cpu_family == CPU_OPTERON)
 		fidvid_msr_init();
 
 	/* run on any CPU again */
 	set_cpus_allowed(current, oldmask);
 
 	pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cpus = cpumask_of_cpu(pol->cpu);
 	else
 		pol->cpus = cpu_core_map[pol->cpu];
@@ -1215,7 +1215,7 @@ static int __cpuinit powernowk8_cpu_init
 	pol->cpuinfo.transition_latency = (((data->rvo + 8) *
data->vstable * VST_UNITS_20US)
 	    + (3 * (1 << data->irt) * 10)) * 1000;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cur = find_khz_freq_from_fiddid(data->currfid,
data->currdid);
 	else
 		pol->cur = find_khz_freq_from_fid(data->currfid);
@@ -1232,7 +1232,7 @@ static int __cpuinit powernowk8_cpu_init
 
 	cpufreq_frequency_table_get_attr(data->powernow_table,
pol->cpu);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		dprintk("cpu_init done, current fid 0x%x, did 0x%x\n",
 			data->currfid, data->currdid);
 	else

[-- Attachment #2: clarify_cpu_family.patch --]
[-- Type: application/octet-stream, Size: 3799 bytes --]

signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

--- linux-mm6-2.6.17/arch/i386/kernel/cpu/cpufreq/powernow-k8.c.orig	2006-06-08 09:44:17.000000000 -0500
+++ linux-mm6-2.6.17/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	2006-06-08 09:58:01.000000000 -0500
@@ -120,7 +120,7 @@ static int pending_bit_stuck(void)
 {
 	u32 lo, hi;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		return 0;
 
 	rdmsr(MSR_FIDVID_STATUS, lo, hi);
@@ -136,7 +136,7 @@ static int query_current_values_with_pen
 	u32 lo, hi;
 	u32 i = 0;
 
-	if (cpu_family) {
+	if (cpu_family == CPU_HW_PSTATE) {
 		rdmsr(MSR_PSTATE_STATUS, lo, hi);
 		i = lo & HW_PSTATE_MASK;
 		rdmsr(MSR_PSTATE_DEF_BASE + i, lo, hi);
@@ -598,7 +598,7 @@ static void print_basics(struct powernow
 	int j;
 	for (j = 0; j < data->numps; j++) {
 		if (data->powernow_table[j].frequency != CPUFREQ_ENTRY_INVALID) {
-			if (cpu_family) {
+			if (cpu_family == CPU_HW_PSTATE) {
 			printk(KERN_INFO PFX "   %d : fid 0x%x gid 0x%x (%d MHz)\n", j, (data->powernow_table[j].index & 0xff00) >> 8,
 				(data->powernow_table[j].index & 0xff0000) >> 16,
 				data->powernow_table[j].frequency/1000);
@@ -758,7 +758,7 @@ static int find_psb_table(struct powerno
 #ifdef CONFIG_X86_POWERNOW_K8_ACPI
 static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index)
 {
-	if (!data->acpi_data.state_count || cpu_family)
+	if (!data->acpi_data.state_count || (cpu_family == CPU_HW_PSTATE))
 		return;
 
 	data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK;
@@ -801,7 +801,7 @@ static int powernow_k8_cpu_init_acpi(str
 		goto err_out;
 	}
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		ret_val = fill_powernow_table_pstate(data, powernow_table);
 	else
 		ret_val = fill_powernow_table_fidvid(data, powernow_table);
@@ -1082,7 +1082,7 @@ static int powernowk8_target(struct cpuf
 	if (query_current_values_with_pending_wait(data))
 		goto err_out;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		dprintk("targ: curr fid 0x%x, did 0x%x\n",
 			data->currfid, data->currvid);
 	else {
@@ -1103,7 +1103,7 @@ static int powernowk8_target(struct cpuf
 
 	powernow_k8_acpi_pst_values(data, newstate);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		ret = transition_frequency_pstate(data, newstate);
 	else
 		ret = transition_frequency_fidvid(data, newstate);
@@ -1115,7 +1115,7 @@ static int powernowk8_target(struct cpuf
 	}
 	mutex_unlock(&fidvid_mutex);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cur = find_khz_freq_from_fiddid(data->currfid, data->currdid);
 	else
 		pol->cur = find_khz_freq_from_fid(data->currfid);
@@ -1197,14 +1197,14 @@ static int __cpuinit powernowk8_cpu_init
 	if (query_current_values_with_pending_wait(data))
 		goto err_out;
 
-	if (!cpu_family)
+	if (cpu_family == CPU_OPTERON)
 		fidvid_msr_init();
 
 	/* run on any CPU again */
 	set_cpus_allowed(current, oldmask);
 
 	pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cpus = cpumask_of_cpu(pol->cpu);
 	else
 		pol->cpus = cpu_core_map[pol->cpu];
@@ -1215,7 +1215,7 @@ static int __cpuinit powernowk8_cpu_init
 	pol->cpuinfo.transition_latency = (((data->rvo + 8) * data->vstable * VST_UNITS_20US)
 	    + (3 * (1 << data->irt) * 10)) * 1000;
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		pol->cur = find_khz_freq_from_fiddid(data->currfid, data->currdid);
 	else
 		pol->cur = find_khz_freq_from_fid(data->currfid);
@@ -1232,7 +1232,7 @@ static int __cpuinit powernowk8_cpu_init
 
 	cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
 
-	if (cpu_family)
+	if (cpu_family == CPU_HW_PSTATE)
 		dprintk("cpu_init done, current fid 0x%x, did 0x%x\n",
 			data->currfid, data->currdid);
 	else

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-20  5:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 15:30 [PATCH][1/2] Clarify cpu_family statements Langsdorf, Mark
2006-06-20  5:47 ` Dave Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.