Lines Matching +full:- +full:affinity

1 // SPDX-License-Identifier: GPL-2.0
31 int ret = -ENODEV; in probe_current_pmu()
35 for (; info->init != NULL; info++) { in probe_current_pmu()
36 if ((cpuid & info->mask) != info->cpuid) in probe_current_pmu()
38 ret = info->init(pmu); in probe_current_pmu()
49 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; in pmu_parse_percpu_irq()
51 ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus); in pmu_parse_percpu_irq()
55 for_each_cpu(cpu, &pmu->supported_cpus) in pmu_parse_percpu_irq()
56 per_cpu(hw_events->irq, cpu) = irq; in pmu_parse_percpu_irq()
63 return !!of_find_property(node, "interrupt-affinity", NULL); in pmu_has_irq_affinity()
72 * If we don't have an interrupt-affinity property, we guess irq in pmu_parse_irq_affinity()
73 * affinity matches our logical CPU order, as we used to assume. in pmu_parse_irq_affinity()
76 if (!pmu_has_irq_affinity(dev->of_node)) in pmu_parse_irq_affinity()
79 dn = of_parse_phandle(dev->of_node, "interrupt-affinity", i); in pmu_parse_irq_affinity()
81 dev_warn(dev, "failed to parse interrupt-affinity[%d]\n", i); in pmu_parse_irq_affinity()
82 return -EINVAL; in pmu_parse_irq_affinity()
99 struct platform_device *pdev = pmu->plat_device; in pmu_parse_irqs()
100 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; in pmu_parse_irqs()
101 struct device *dev = &pdev->dev; in pmu_parse_irqs()
113 pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; in pmu_parse_irqs()
114 cpumask_setall(&pmu->supported_cpus); in pmu_parse_irqs()
124 if (nr_cpu_ids != 1 && !pmu_has_irq_affinity(dev->of_node)) in pmu_parse_irqs()
125 dev_warn(dev, "no interrupt-affinity property, guessing.\n"); in pmu_parse_irqs()
136 return -EINVAL; in pmu_parse_irqs()
145 if (per_cpu(hw_events->irq, cpu)) { in pmu_parse_irqs()
147 return -EINVAL; in pmu_parse_irqs()
150 per_cpu(hw_events->irq, cpu) = irq; in pmu_parse_irqs()
151 cpumask_set_cpu(cpu, &pmu->supported_cpus); in pmu_parse_irqs()
159 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events; in armpmu_request_irqs()
162 for_each_cpu(cpu, &armpmu->supported_cpus) { in armpmu_request_irqs()
163 int irq = per_cpu(hw_events->irq, cpu); in armpmu_request_irqs()
178 struct pmu_hw_events __percpu *hw_events = armpmu->hw_events; in armpmu_free_irqs()
180 for_each_cpu(cpu, &armpmu->supported_cpus) { in armpmu_free_irqs()
181 int irq = per_cpu(hw_events->irq, cpu); in armpmu_free_irqs()
192 struct device *dev = &pdev->dev; in arm_pmu_device_probe()
194 int ret = -ENODEV; in arm_pmu_device_probe()
198 return -ENOMEM; in arm_pmu_device_probe()
200 pmu->plat_device = pdev; in arm_pmu_device_probe()
208 pmu->secure_access = of_property_read_bool(dev->of_node, in arm_pmu_device_probe()
209 "secure-reg-access"); in arm_pmu_device_probe()
211 /* arm64 systems boot only as non-secure */ in arm_pmu_device_probe()
212 if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) { in arm_pmu_device_probe()
213 dev_warn(dev, "ignoring \"secure-reg-access\" property for arm64\n"); in arm_pmu_device_probe()
214 pmu->secure_access = false; in arm_pmu_device_probe()
219 cpumask_setall(&pmu->supported_cpus); in arm_pmu_device_probe()