Mario Limonciello b79276dcac ACPI: processor: Move arch_init_invariance_cppc() call later
arch_init_invariance_cppc() is called at the end of
acpi_cppc_processor_probe() in order to configure frequency invariance
based upon the values from _CPC.

This however doesn't work on AMD CPPC shared memory designs that have
AMD preferred cores enabled because _CPC needs to be analyzed from all
cores to judge if preferred cores are enabled.

This issue manifests to users as a warning since commit 21fb59ab4b97
("ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn"):
```
Could not retrieve highest performance (-19)
```

However the warning isn't the cause of this, it was actually
commit 279f838a61f9 ("x86/amd: Detect preferred cores in
amd_get_boost_ratio_numerator()") which exposed the issue.

To fix this problem, change arch_init_invariance_cppc() into a new weak
symbol that is called at the end of acpi_processor_driver_init().
Each architecture that supports it can declare the symbol to override
the weak one.

Define it for x86, in arch/x86/kernel/acpi/cppc.c, and for all of the
architectures using the generic arch_topology.c code.

Fixes: 279f838a61f9 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()")
Reported-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219431
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20241104222855.3959267-1-superm1@kernel.org
[ rjw: Changelog edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-11-06 21:31:36 +01:00
..
2024-09-11 21:42:20 +02:00
2024-10-05 10:40:16 -07:00
2024-04-08 16:10:27 +02:00
2024-09-03 21:15:30 -07:00
2024-10-04 11:59:36 -07:00
2024-05-28 11:53:35 +02:00
2024-05-28 11:53:35 +02:00
2024-05-28 11:53:35 +02:00
2024-09-24 15:32:06 +08:00
2024-05-28 11:53:35 +02:00
2024-03-27 16:36:45 +01:00
2023-09-21 20:55:43 +02:00
2024-07-19 10:10:33 -05:00
2022-01-22 08:33:37 +02:00
2020-11-09 19:08:06 +01:00
2023-03-27 20:50:28 +02:00
2024-07-04 14:36:03 +01:00
2020-11-09 19:08:06 +01:00