Thread (10 messages) 10 messages, 4 authors, 2021-05-13

Re: [PATCH v4] x86, sched: Fix the AMD CPPC maximum perf on some specific generations

From: Alexander Monakov <hidden>
Date: 2021-05-12 22:38:05
Also in: lkml, stable

On Sun, 25 Apr 2021, Huang Rui wrote:
Some AMD Ryzen generations has different calculation method on maximum
perf. 255 is not for all asics, some specific generations should use 166
as the maximum perf. Otherwise, it will report incorrect frequency value
like below:
The commit message says '255', but the code:
quoted hunk ↗ jump to hunk
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1170,3 +1170,19 @@ void set_dr_addr_mask(unsigned long mask, int dr)
 		break;
 	}
 }
+
+u32 amd_get_highest_perf(void)
+{
+	struct cpuinfo_x86 *c = &boot_cpu_data;
+
+	if (c->x86 == 0x17 && ((c->x86_model >= 0x30 && c->x86_model < 0x40) ||
+			       (c->x86_model >= 0x70 && c->x86_model < 0x80)))
+	    return 166;
+
+	if (c->x86 == 0x19 && ((c->x86_model >= 0x20 && c->x86_model < 0x30) ||
+			       (c->x86_model >= 0x40 && c->x86_model < 0x70)))
+	    return 166;
+
+	return 225;
+}
says 225? This is probably a typo? In any case they are out of sync.

Alexander
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help