Lines Matching +full:cluster +full:- +full:cpufreq
1 // SPDX-License-Identifier: GPL-2.0
11 #include <linux/cpufreq.h>
47 * want to update the scale factor with information from CPUFREQ. in topology_set_freq_scale()
83 return sysfs_emit(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id)); in cpu_capacity_show()
118 * Updating the sched_domains can't be done directly from cpufreq callbacks
176 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", in topology_parse_cpu_capacity()
194 * For non-clk CPU DVFS mechanism, there's no way to get the in topology_parse_cpu_capacity()
237 cpumask_pr_args(policy->related_cpus), in init_cpu_capacity_callback()
240 cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus); in init_cpu_capacity_callback()
242 for_each_cpu(cpu, policy->related_cpus) in init_cpu_capacity_callback()
243 per_cpu(freq_factor, cpu) = policy->cpuinfo.max_freq / 1000; in init_cpu_capacity_callback()
265 * on ACPI-based systems we need to use the default cpu capacity in register_cpufreq_notifier()
267 * skip registering cpufreq notifier. in register_cpufreq_notifier()
270 return -EINVAL; in register_cpufreq_notifier()
273 return -ENOMEM; in register_cpufreq_notifier()
303 * (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
307 * (3) -1 if the node does not exist in the device tree
316 return -1; in get_cpu_for_node()
348 } else if (cpu != -ENODEV) { in parse_core()
351 return -EINVAL; in parse_core()
363 return -EINVAL; in parse_core()
368 } else if (leaf && cpu != -ENODEV) { in parse_core()
370 return -EINVAL; in parse_core()
376 static int __init parse_cluster(struct device_node *cluster, int depth) in parse_cluster() argument
393 snprintf(name, sizeof(name), "cluster%d", i); in parse_cluster()
394 c = of_get_child_by_name(cluster, name); in parse_cluster()
409 c = of_get_child_by_name(cluster, name); in parse_cluster()
414 pr_err("%pOF: cpu-map children should be clusters\n", in parse_cluster()
417 return -EINVAL; in parse_cluster()
423 pr_err("%pOF: Non-leaf cluster with core %s\n", in parse_cluster()
424 cluster, name); in parse_cluster()
425 ret = -EINVAL; in parse_cluster()
436 pr_warn("%pOF: empty cluster\n", cluster); in parse_cluster()
457 * When topology is provided cpu-map is essentially a root in parse_dt_topology()
458 * cluster with restricted subnodes. in parse_dt_topology()
460 map = of_get_child_by_name(cn, "cpu-map"); in parse_dt_topology()
475 if (cpu_topology[cpu].package_id == -1) in parse_dt_topology()
476 ret = -EINVAL; in parse_dt_topology()
501 if (cpu_topology[cpu].llc_id != -1) { in cpu_coregroup_mask()
518 if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { in update_siblings_masks()
519 cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); in update_siblings_masks()
520 cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); in update_siblings_masks()
523 if (cpuid_topo->package_id != cpu_topo->package_id) in update_siblings_masks()
526 cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); in update_siblings_masks()
527 cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); in update_siblings_masks()
529 if (cpuid_topo->core_id != cpu_topo->core_id) in update_siblings_masks()
532 cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); in update_siblings_masks()
533 cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); in update_siblings_masks()
541 cpumask_clear(&cpu_topo->llc_sibling); in clear_cpu_topology()
542 cpumask_set_cpu(cpu, &cpu_topo->llc_sibling); in clear_cpu_topology()
544 cpumask_clear(&cpu_topo->core_sibling); in clear_cpu_topology()
545 cpumask_set_cpu(cpu, &cpu_topo->core_sibling); in clear_cpu_topology()
546 cpumask_clear(&cpu_topo->thread_sibling); in clear_cpu_topology()
547 cpumask_set_cpu(cpu, &cpu_topo->thread_sibling); in clear_cpu_topology()
557 cpu_topo->thread_id = -1; in reset_cpu_topology()
558 cpu_topo->core_id = -1; in reset_cpu_topology()
559 cpu_topo->package_id = -1; in reset_cpu_topology()
560 cpu_topo->llc_id = -1; in reset_cpu_topology()
604 if (cpuid_topo->package_id != -1) in store_cpu_topology()
607 cpuid_topo->thread_id = -1; in store_cpu_topology()
608 cpuid_topo->core_id = cpuid; in store_cpu_topology()
609 cpuid_topo->package_id = cpu_to_node(cpuid); in store_cpu_topology()
612 cpuid, cpuid_topo->package_id, cpuid_topo->core_id, in store_cpu_topology()
613 cpuid_topo->thread_id); in store_cpu_topology()