Lines Matching +full:spe +full:- +full:pmu
1 // SPDX-License-Identifier: GPL-2.0-only
29 gsi = gicc->performance_interrupt; in arm_pmu_acpi_register_irq()
32 * Per the ACPI spec, the MADT cannot describe a PMU that doesn't in arm_pmu_acpi_register_irq()
41 if (gicc->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE) in arm_pmu_acpi_register_irq()
67 gsi = gicc->performance_interrupt; in arm_pmu_acpi_unregister_irq()
83 if (pdev->num_resources != 1) in arm_acpi_register_pmu_device()
84 return -ENXIO; in arm_acpi_register_pmu_device()
86 if (pdev->resource[0].flags != IORESOURCE_IRQ) in arm_acpi_register_pmu_device()
87 return -ENXIO; in arm_acpi_register_pmu_device()
97 if (gicc->header.length < len) in arm_acpi_register_pmu_device()
98 return gsi ? -ENXIO : 0; in arm_acpi_register_pmu_device()
106 pr_warn("ACPI: %s: must be homogeneous\n", pdev->name); in arm_acpi_register_pmu_device()
107 return -ENXIO; in arm_acpi_register_pmu_device()
116 pr_warn("ACPI: %s Unable to register interrupt: %d\n", pdev->name, gsi); in arm_acpi_register_pmu_device()
117 return -ENXIO; in arm_acpi_register_pmu_device()
120 pdev->resource[0].start = irq; in arm_acpi_register_pmu_device()
138 .id = -1,
145 return gicc->spe_interrupt; in arm_spe_parse_gsi()
149 * For lack of a better place, hook the normal PMU MADT walk
150 * and create a SPE device if we detect a recent MADT with
158 pr_warn("ACPI: SPE: Unable to register device\n"); in arm_spe_acpi_register_device()
176 .id = -1,
183 return gicc->trbe_interrupt; in arm_trbe_parse_gsi()
208 pr_warn("Unable to parse ACPI PMU IRQ for CPU%d: %d\n", in arm_pmu_acpi_parse_irqs()
212 pr_warn("No ACPI PMU IRQ for CPU%d\n", cpu); in arm_pmu_acpi_parse_irqs()
217 * it. We'll have to sanity-check IRQs later when we associate in arm_pmu_acpi_parse_irqs()
252 struct arm_pmu *pmu; in arm_pmu_acpi_find_pmu() local
256 pmu = per_cpu(probed_pmus, cpu); in arm_pmu_acpi_find_pmu()
257 if (!pmu || pmu->acpi_cpuid != cpuid) in arm_pmu_acpi_find_pmu()
260 return pmu; in arm_pmu_acpi_find_pmu()
268 * the PMU (e.g. we don't have mismatched PPIs).
270 static bool pmu_irq_matches(struct arm_pmu *pmu, int irq) in pmu_irq_matches() argument
272 struct pmu_hw_events __percpu *hw_events = pmu->hw_events; in pmu_irq_matches()
278 for_each_cpu(cpu, &pmu->supported_cpus) { in pmu_irq_matches()
279 int other_irq = per_cpu(hw_events->irq, cpu); in pmu_irq_matches()
295 static void arm_pmu_acpi_associate_pmu_cpu(struct arm_pmu *pmu, in arm_pmu_acpi_associate_pmu_cpu() argument
300 per_cpu(probed_pmus, cpu) = pmu; in arm_pmu_acpi_associate_pmu_cpu()
302 if (pmu_irq_matches(pmu, irq)) { in arm_pmu_acpi_associate_pmu_cpu()
304 hw_events = pmu->hw_events; in arm_pmu_acpi_associate_pmu_cpu()
305 per_cpu(hw_events->irq, cpu) = irq; in arm_pmu_acpi_associate_pmu_cpu()
308 cpumask_set_cpu(cpu, &pmu->supported_cpus); in arm_pmu_acpi_associate_pmu_cpu()
322 struct arm_pmu *pmu; in arm_pmu_acpi_cpu_starting() local
328 pmu = arm_pmu_acpi_find_pmu(); in arm_pmu_acpi_cpu_starting()
329 if (!pmu) { in arm_pmu_acpi_cpu_starting()
330 pr_warn_ratelimited("Unable to associate CPU%d with a PMU\n", in arm_pmu_acpi_cpu_starting()
335 arm_pmu_acpi_associate_pmu_cpu(pmu, cpu); in arm_pmu_acpi_cpu_starting()
339 static void arm_pmu_acpi_probe_matching_cpus(struct arm_pmu *pmu, in arm_pmu_acpi_probe_matching_cpus() argument
348 arm_pmu_acpi_associate_pmu_cpu(pmu, cpu); in arm_pmu_acpi_probe_matching_cpus()
376 * without tying this too deeply into the "real" PMU driver. in arm_pmu_acpi_probe()
379 * of a PMU's CPUs to be online at probe time. in arm_pmu_acpi_probe()
382 struct arm_pmu *pmu = per_cpu(probed_pmus, cpu); in arm_pmu_acpi_probe() local
387 if (pmu) in arm_pmu_acpi_probe()
390 pmu = armpmu_alloc(); in arm_pmu_acpi_probe()
391 if (!pmu) { in arm_pmu_acpi_probe()
392 pr_warn("Unable to allocate PMU for CPU%d\n", in arm_pmu_acpi_probe()
394 return -ENOMEM; in arm_pmu_acpi_probe()
398 pmu->acpi_cpuid = cpuid; in arm_pmu_acpi_probe()
400 arm_pmu_acpi_probe_matching_cpus(pmu, cpuid); in arm_pmu_acpi_probe()
402 ret = init_fn(pmu); in arm_pmu_acpi_probe()
403 if (ret == -ENODEV) { in arm_pmu_acpi_probe()
404 /* PMU not handled by this driver, or not present */ in arm_pmu_acpi_probe()
407 pr_warn("Unable to initialise PMU for CPU%d\n", cpu); in arm_pmu_acpi_probe()
411 base_name = pmu->name; in arm_pmu_acpi_probe()
412 pmu->name = kasprintf(GFP_KERNEL, "%s_%d", base_name, pmu_idx++); in arm_pmu_acpi_probe()
413 if (!pmu->name) { in arm_pmu_acpi_probe()
414 pr_warn("Unable to allocate PMU name for CPU%d\n", cpu); in arm_pmu_acpi_probe()
415 return -ENOMEM; in arm_pmu_acpi_probe()
418 ret = armpmu_register(pmu); in arm_pmu_acpi_probe()
420 pr_warn("Failed to register PMU for CPU%d\n", cpu); in arm_pmu_acpi_probe()
421 kfree(pmu->name); in arm_pmu_acpi_probe()