Skip to content

Commit 606f422

Browse files
Prashanth Prakashctmarinas
authored andcommitted
arm64: skip register_cpufreq_notifier on ACPI-based systems
On ACPI based systems where the topology is setup using the API store_cpu_topology, at the moment we do not have necessary code to parse cpu capacity and handle cpufreq notifier, thus resulting in a kernel panic. Stack: init_cpu_capacity_callback+0xb4/0x1c8 notifier_call_chain+0x5c/0xa0 __blocking_notifier_call_chain+0x58/0xa0 blocking_notifier_call_chain+0x3c/0x50 cpufreq_set_policy+0xe4/0x328 cpufreq_init_policy+0x80/0x100 cpufreq_online+0x418/0x710 cpufreq_add_dev+0x118/0x180 subsys_interface_register+0xa4/0xf8 cpufreq_register_driver+0x1c0/0x298 cppc_cpufreq_init+0xdc/0x1000 [cppc_cpufreq] do_one_initcall+0x5c/0x168 do_init_module+0x64/0x1e4 load_module+0x130c/0x14d0 SyS_finit_module+0x108/0x120 el0_svc_naked+0x24/0x28 Fixes: 7202bde ("arm64: parse cpu capacity-dmips-mhz from DT") Acked-by: Will Deacon <[email protected]> Signed-off-by: Prashanth Prakash <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 7a308bb commit 606f422

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/arm64/kernel/topology.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* for more details.
1212
*/
1313

14+
#include <linux/acpi.h>
1415
#include <linux/cpu.h>
1516
#include <linux/cpumask.h>
1617
#include <linux/init.h>
@@ -209,7 +210,12 @@ static struct notifier_block init_cpu_capacity_notifier = {
209210

210211
static int __init register_cpufreq_notifier(void)
211212
{
212-
if (cap_parsing_failed)
213+
/*
214+
* on ACPI-based systems we need to use the default cpu capacity
215+
* until we have the necessary code to parse the cpu capacity, so
216+
* skip registering cpufreq notifier.
217+
*/
218+
if (!acpi_disabled || cap_parsing_failed)
213219
return -EINVAL;
214220

215221
if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL)) {

0 commit comments

Comments
 (0)