Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 9942cb22ea45 ("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>

authored by

Vincent Guittot and committed by
Greg Kroah-Hartman
98323e9d 41bccc98

+6 -7
+6 -7
drivers/base/arch_topology.c
··· 431 431 struct cpufreq_policy *policy = data; 432 432 int cpu; 433 433 434 - if (!raw_capacity) 435 - return 0; 436 - 437 434 if (val != CPUFREQ_CREATE_POLICY) 438 435 return 0; 439 436 ··· 447 450 } 448 451 449 452 if (cpumask_empty(cpus_to_visit)) { 450 - topology_normalize_cpu_scale(); 451 - schedule_work(&update_topology_flags_work); 452 - free_raw_capacity(); 453 + if (raw_capacity) { 454 + topology_normalize_cpu_scale(); 455 + schedule_work(&update_topology_flags_work); 456 + free_raw_capacity(); 457 + } 453 458 pr_debug("cpu_capacity: parsing done\n"); 454 459 schedule_work(&parsing_done_work); 455 460 } ··· 471 472 * On ACPI-based systems skip registering cpufreq notifier as cpufreq 472 473 * information is not needed for cpu capacity initialization. 473 474 */ 474 - if (!acpi_disabled || !raw_capacity) 475 + if (!acpi_disabled) 475 476 return -EINVAL; 476 477 477 478 if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL))