Skip to content

Commit 98323e9

Browse files
vingu-linarogregkh
authored andcommitted
topology: Set capacity_freq_ref in all cases
If "capacity-dmips-mhz" is not set, raw_capacity is null and we skip the normalization step which includes setting per_cpu capacity_freq_ref. Always register the notifier but skip the capacity normalization if raw_capacity is null. Fixes: 9942cb2 ("sched/topology: Add a new arch_scale_freq_ref() method") Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Tested-by: Pierre Gondois <pierre.gondois@arm.com> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Link: https://lore.kernel.org/r/20240117190545.596057-1-vincent.guittot@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 41bccc9 commit 98323e9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/base/arch_topology.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,6 @@ init_cpu_capacity_callback(struct notifier_block *nb,
431431
struct cpufreq_policy *policy = data;
432432
int cpu;
433433

434-
if (!raw_capacity)
435-
return 0;
436-
437434
if (val != CPUFREQ_CREATE_POLICY)
438435
return 0;
439436

@@ -450,9 +447,11 @@ init_cpu_capacity_callback(struct notifier_block *nb,
450447
}
451448

452449
if (cpumask_empty(cpus_to_visit)) {
453-
topology_normalize_cpu_scale();
454-
schedule_work(&update_topology_flags_work);
455-
free_raw_capacity();
450+
if (raw_capacity) {
451+
topology_normalize_cpu_scale();
452+
schedule_work(&update_topology_flags_work);
453+
free_raw_capacity();
454+
}
456455
pr_debug("cpu_capacity: parsing done\n");
457456
schedule_work(&parsing_done_work);
458457
}
@@ -472,7 +471,7 @@ static int __init register_cpufreq_notifier(void)
472471
* On ACPI-based systems skip registering cpufreq notifier as cpufreq
473472
* information is not needed for cpu capacity initialization.
474473
*/
475-
if (!acpi_disabled || !raw_capacity)
474+
if (!acpi_disabled)
476475
return -EINVAL;
477476

478477
if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL))

0 commit comments

Comments
 (0)