x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations
[linux-2.6-microblaze.git] / arch / x86 / kernel / cpu / amd.c
index 2d11384..6d7b3b3 100644 (file)
@@ -1165,3 +1165,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 255;
+}
+EXPORT_SYMBOL_GPL(amd_get_highest_perf);