Commit acd316248205d553594296f1895ba5196b89ffcc

Authored by Andre Przywara
Committed by Rafael J. Wysocki
1 parent 3dc9a633f8

acpi-cpufreq: Add quirk to disable _PSD usage on all AMD CPUs

To workaround some Windows specific behavior, the ACPI _PSD table
on AMD desktop boards advertises all cores as dependent, meaning
that they all can only use the same P-state. acpi-cpufreq strictly
obeys this description, instantiating one CPU only and symlinking
the others. But the hardware can have distinct frequencies for each
core and powernow-k8 did it that way.
So, in order to use the hardware to its full potential and keep the
original powernow-k8 behavior, lets override the _PSD table setting
on AMD hardware.
We use the siblings table, as it matches the current hardware
behavior.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Showing 1 changed file with 10 additions and 0 deletions Side-by-side Diff

drivers/cpufreq/acpi-cpufreq.c
... ... @@ -51,6 +51,8 @@
51 51 MODULE_DESCRIPTION("ACPI Processor P-States Driver");
52 52 MODULE_LICENSE("GPL");
53 53  
  54 +#define PFX "acpi-cpufreq: "
  55 +
54 56 enum {
55 57 UNDEFINED_CAPABLE = 0,
56 58 SYSTEM_INTEL_MSR_CAPABLE,
... ... @@ -585,6 +587,14 @@
585 587 if (bios_with_sw_any_bug && cpumask_weight(policy->cpus) == 1) {
586 588 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
587 589 cpumask_copy(policy->cpus, cpu_core_mask(cpu));
  590 + }
  591 +
  592 + if (check_amd_hwpstate_cpu(cpu) && !acpi_pstate_strict) {
  593 + cpumask_clear(policy->cpus);
  594 + cpumask_set_cpu(cpu, policy->cpus);
  595 + cpumask_copy(policy->related_cpus, cpu_sibling_mask(cpu));
  596 + policy->shared_type = CPUFREQ_SHARED_TYPE_HW;
  597 + pr_info_once(PFX "overriding BIOS provided _PSD data\n");
588 598 }
589 599 #endif
590 600