cpufreq: intel_pstate: Use HWP to initialize ITMT if CPPC is missing
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Jun 2024 16:14:53 +0000 (18:14 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 24 Jun 2024 18:55:11 +0000 (20:55 +0200)
commita1ff59784b277795a613beaa5d3dd9c5595c69a7
treef130a1d06bd6ba029c593d6fe93e3288e91f09ef
parentf2661062f16b2de5d7b6a5c42a9a5c96326b8454
cpufreq: intel_pstate: Use HWP to initialize ITMT if CPPC is missing

It is reported that single-thread performance on some hybrid systems
dropped significantly after commit 7feec7430edd ("ACPI: CPPC: Only probe
for _CPC if CPPC v2 is acked") which prevented _CPC from being used if
the support for it had not been confirmed by the platform firmware.

The problem is that if the platform firmware does not confirm CPPC v2
support, cppc_get_perf_caps() returns an error which prevents the
intel_pstate driver from enabling ITMT.  Consequently, the scheduler
does not get any hints on CPU performance differences, so in a hybrid
system some tasks may run on CPUs with lower capacity even though they
should be running on high-capacity CPUs.

To address this, modify intel_pstate to use the information from
MSR_HWP_CAPABILITIES to enable ITMT if CPPC is not available (which is
done already if the highest performance number coming from CPPC is not
realistic).

Fixes: 7feec7430edd ("ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked")
Closes: https://lore.kernel.org/linux-acpi/d01b0a1f-bd33-47fe-ab41-43843d8a374f@kfocus.org
Link: https://lore.kernel.org/linux-acpi/ZnD22b3Br1ng7alf@kf-XE
Reported-by: Aaron Rainbolt <arainbolt@kfocus.org>
Tested-by: Aaron Rainbolt <arainbolt@kfocus.org>
Cc: 5.19+ <stable@vger.kernel.org> # 5.19+
Link: https://patch.msgid.link/12460110.O9o76ZdvQC@rjwysocki.net
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/intel_pstate.c