Lines Matching +full:cpufreq +full:- +full:hw
1 // SPDX-License-Identifier: GPL-2.0
13 #include <linux/cpufreq.h>
53 * either cpufreq or counter driven. If the support status changes as in update_scale_freq_invariant()
71 * supported by cpufreq. in topology_set_scale_freq_source()
82 if (!sfd || sfd->source != SCALE_FREQ_SOURCE_ARCH) { in topology_set_scale_freq_source()
105 if (sfd && sfd->source == source) { in topology_clear_scale_freq_source()
115 * use-after-free races. in topology_clear_scale_freq_source()
128 sfd->set_freq_scale(); in topology_scale_freq_tick()
145 * want to update the scale factor with information from CPUFREQ. in topology_set_freq_scale()
168 * topology_update_hw_pressure() - Update HW pressure for CPUs
172 * Update the value of HW pressure for all @cpus in the mask. The
174 * operating on stale data when hot-plug is used for some CPUs. The
176 * HW capping. It might be also a boost frequency value, which is bigger
179 * there is no HW throttling. The @capped_freq must be provided in kHz.
194 * the HW pressure value. in topology_update_hw_pressure()
201 pressure = max_capacity - capacity; in topology_update_hw_pressure()
216 return sysfs_emit(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id)); in cpu_capacity_show()
229 return -ENOENT; in cpu_capacity_sysctl_add()
241 return -ENOENT; in cpu_capacity_sysctl_remove()
250 cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "topology/cpu-capacity", in register_cpu_capacity_sysctl()
265 * Updating the sched_domains can't be done directly from cpufreq callbacks
324 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", in topology_parse_cpu_capacity()
342 * For non-clk CPU DVFS mechanism, there's no way to get the in topology_parse_cpu_capacity()
446 cpumask_pr_args(policy->related_cpus), in init_cpu_capacity_callback()
449 cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus); in init_cpu_capacity_callback()
451 for_each_cpu(cpu, policy->related_cpus) { in init_cpu_capacity_callback()
452 per_cpu(capacity_freq_ref, cpu) = policy->cpuinfo.max_freq; in init_cpu_capacity_callback()
479 * On ACPI-based systems skip registering cpufreq notifier as cpufreq in register_cpufreq_notifier()
483 return -EINVAL; in register_cpufreq_notifier()
486 return -ENOMEM; in register_cpufreq_notifier()
520 * (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
524 * (3) -1 if the node does not exist in the device tree
533 return -1; in get_cpu_for_node()
568 } else if (cpu != -ENODEV) { in parse_core()
570 return -EINVAL; in parse_core()
582 return -EINVAL; in parse_core()
588 } else if (leaf && cpu != -ENODEV) { in parse_core()
590 return -EINVAL; in parse_core()
641 pr_err("%pOF: cpu-map children should be clusters\n", c); in parse_cluster()
642 return -EINVAL; in parse_cluster()
650 pr_err("%pOF: Non-leaf cluster with core %s\n", in parse_cluster()
652 return -EINVAL; in parse_cluster()
679 ret = parse_cluster(c, package_id, -1, 0); in parse_socket()
687 ret = parse_cluster(socket, 0, -1, 0); in parse_socket()
716 * When topology is provided cpu-map is essentially a root in parse_dt_topology()
720 of_get_child_by_name(cn, "cpu-map"); in parse_dt_topology()
737 return -EINVAL; in parse_dt_topology()
766 * For systems with no shared cpu-side LLC but with clusters defined, in cpu_coregroup_mask()
796 if (ret && ret != -ENOENT) in update_siblings_masks()
804 cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); in update_siblings_masks()
805 cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); in update_siblings_masks()
808 if (cpuid_topo->package_id != cpu_topo->package_id) in update_siblings_masks()
811 cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); in update_siblings_masks()
812 cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); in update_siblings_masks()
814 if (cpuid_topo->cluster_id != cpu_topo->cluster_id) in update_siblings_masks()
817 if (cpuid_topo->cluster_id >= 0) { in update_siblings_masks()
818 cpumask_set_cpu(cpu, &cpuid_topo->cluster_sibling); in update_siblings_masks()
819 cpumask_set_cpu(cpuid, &cpu_topo->cluster_sibling); in update_siblings_masks()
822 if (cpuid_topo->core_id != cpu_topo->core_id) in update_siblings_masks()
825 cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); in update_siblings_masks()
826 cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); in update_siblings_masks()
834 cpumask_clear(&cpu_topo->llc_sibling); in clear_cpu_topology()
835 cpumask_set_cpu(cpu, &cpu_topo->llc_sibling); in clear_cpu_topology()
837 cpumask_clear(&cpu_topo->cluster_sibling); in clear_cpu_topology()
838 cpumask_set_cpu(cpu, &cpu_topo->cluster_sibling); in clear_cpu_topology()
840 cpumask_clear(&cpu_topo->core_sibling); in clear_cpu_topology()
841 cpumask_set_cpu(cpu, &cpu_topo->core_sibling); in clear_cpu_topology()
842 cpumask_clear(&cpu_topo->thread_sibling); in clear_cpu_topology()
843 cpumask_set_cpu(cpu, &cpu_topo->thread_sibling); in clear_cpu_topology()
853 cpu_topo->thread_id = -1; in reset_cpu_topology()
854 cpu_topo->core_id = -1; in reset_cpu_topology()
855 cpu_topo->cluster_id = -1; in reset_cpu_topology()
856 cpu_topo->package_id = -1; in reset_cpu_topology()
897 * arch-specific early cache level detection a chance to run. in init_cpu_topology()
906 else if (ret != -ENOENT) in init_cpu_topology()
916 if (cpuid_topo->package_id != -1) in store_cpu_topology()
919 cpuid_topo->thread_id = -1; in store_cpu_topology()
920 cpuid_topo->core_id = cpuid; in store_cpu_topology()
921 cpuid_topo->package_id = cpu_to_node(cpuid); in store_cpu_topology()
924 cpuid, cpuid_topo->package_id, cpuid_topo->core_id, in store_cpu_topology()
925 cpuid_topo->thread_id); in store_cpu_topology()