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

Commit 201bf0f1 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by Dave Jones
Browse files

[CPUFREQ] powernow-k8: Avoid Pstate MSR accesses on systems supporting CPB



Due to CPB we can't directly map SW Pstates to Pstate MSRs. Get rid of
the paranoia check. (assuming that the ACPI Pstate information is
correct.)

Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent d08de0c1
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -926,6 +926,10 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
			invalidate_entry(powernow_table, i);
			continue;
		}
		/* Frequency may be rounded for these */
		if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
				 || boot_cpu_data.x86 == 0x11) {

			rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
			if (!(hi & HW_PSTATE_VALID_MASK)) {
				pr_debug("invalid pstate %d, ignoring\n", index);
@@ -933,16 +937,13 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
				continue;
			}

		powernow_table[i].index = index;

		/* Frequency may be rounded for these */
		if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
				 || boot_cpu_data.x86 == 0x11) {
			powernow_table[i].frequency =
				freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
		} else
			powernow_table[i].frequency =
				data->acpi_data.states[i].core_frequency * 1000;

		powernow_table[i].index = index;
	}
	return 0;
}