Lines Matching full:pmu
25 static int probe_current_pmu(struct arm_pmu *pmu, in probe_current_pmu() argument
32 pr_info("probing PMU on CPU %d\n", cpu); in probe_current_pmu()
37 ret = info->init(pmu); in probe_current_pmu()
45 static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq) in pmu_parse_percpu_irq() argument
48 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; in pmu_parse_percpu_irq()
50 ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus); in pmu_parse_percpu_irq()
54 for_each_cpu(cpu, &pmu->supported_cpus) in pmu_parse_percpu_irq()
95 static int pmu_parse_irqs(struct arm_pmu *pmu) in pmu_parse_irqs() argument
98 struct platform_device *pdev = pmu->plat_device; in pmu_parse_irqs()
99 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; in pmu_parse_irqs()
104 return dev_err_probe(dev, num_irqs, "unable to count PMU IRQs\n"); in pmu_parse_irqs()
107 * In this case we have no idea which CPUs are covered by the PMU. in pmu_parse_irqs()
111 dev_warn(dev, "no irqs for PMU, sampling events not supported\n"); in pmu_parse_irqs()
112 pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; in pmu_parse_irqs()
113 cpumask_setall(&pmu->supported_cpus); in pmu_parse_irqs()
120 return pmu_parse_percpu_irq(pmu, irq); in pmu_parse_irqs()
145 dev_warn(dev, "multiple PMU IRQs for the same CPU detected\n"); in pmu_parse_irqs()
150 cpumask_set_cpu(cpu, &pmu->supported_cpus); in pmu_parse_irqs()
192 struct arm_pmu *pmu; in arm_pmu_device_probe() local
195 pmu = armpmu_alloc(); in arm_pmu_device_probe()
196 if (!pmu) in arm_pmu_device_probe()
199 pmu->plat_device = pdev; in arm_pmu_device_probe()
201 ret = pmu_parse_irqs(pmu); in arm_pmu_device_probe()
207 pmu->secure_access = of_property_read_bool(dev->of_node, in arm_pmu_device_probe()
211 if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) { in arm_pmu_device_probe()
213 pmu->secure_access = false; in arm_pmu_device_probe()
216 ret = init_fn(pmu); in arm_pmu_device_probe()
218 cpumask_setall(&pmu->supported_cpus); in arm_pmu_device_probe()
219 ret = probe_current_pmu(pmu, probe_table); in arm_pmu_device_probe()
223 dev_err(dev, "failed to probe PMU!\n"); in arm_pmu_device_probe()
227 ret = armpmu_request_irqs(pmu); in arm_pmu_device_probe()
231 ret = armpmu_register(pmu); in arm_pmu_device_probe()
233 dev_err(dev, "failed to register PMU devices!\n"); in arm_pmu_device_probe()
240 armpmu_free_irqs(pmu); in arm_pmu_device_probe()
242 armpmu_free(pmu); in arm_pmu_device_probe()