starlink_pmu
struct starlink_pmu *starlink_pmu = to_starlink_pmu(dev_get_drvdata(dev));
return cpumap_print_to_pagebuf(true, buf, &starlink_pmu->cpumask);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
writeq(val, starlink_pmu->pmu_base + STARLINK_PMU_CYCLE_COUNTER);
writeq(val, starlink_pmu->pmu_base + STARLINK_PMU_EVENT_COUNTER +
struct starlink_pmu *starlink_pmu)
val = readq(starlink_pmu->pmu_base + STARLINK_PMU_INTERRUPT_ENABLE);
writeq(event->hw.config, starlink_pmu->pmu_base +
writeq(val, starlink_pmu->pmu_base + STARLINK_PMU_INTERRUPT_ENABLE);
writeq(STARLINK_PMU_GLOBAL_ENABLE, starlink_pmu->pmu_base +
struct starlink_pmu *starlink_pmu)
val = readq(starlink_pmu->pmu_base + STARLINK_PMU_CONTROL);
writeq(val, starlink_pmu->pmu_base + STARLINK_PMU_CONTROL);
val = readq(starlink_pmu->pmu_base + STARLINK_PMU_INTERRUPT_ENABLE);
writeq(val, starlink_pmu->pmu_base + STARLINK_PMU_INTERRUPT_ENABLE);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
new_raw_count = readq(starlink_pmu->pmu_base +
new_raw_count = readq(starlink_pmu->pmu_base +
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
starlink_pmu_counter_start(event, starlink_pmu);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
starlink_pmu_counter_stop(event, starlink_pmu);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
this_cpu_ptr(starlink_pmu->hw_events);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
this_cpu_ptr(starlink_pmu->hw_events);
struct starlink_pmu *starlink_pmu = to_starlink_pmu(event->pmu);
event->cpu = cpumask_first(&starlink_pmu->cpumask);
struct starlink_pmu *starlink_pmu = data;
this_cpu_ptr(starlink_pmu->hw_events);
overflow_status = readq(starlink_pmu->pmu_base +
writeq(BIT_ULL(idx), starlink_pmu->pmu_base +
static int starlink_setup_irqs(struct starlink_pmu *starlink_pmu,
0, STARLINK_PMU_PDEV_NAME, starlink_pmu);
starlink_pmu->irq = irq;
struct starlink_pmu *starlink_pmu = container_of(b, struct starlink_pmu,
this_cpu_ptr(starlink_pmu->hw_events);
static int starlink_pmu_pm_register(struct starlink_pmu *starlink_pmu)
starlink_pmu->starlink_pmu_pm_nb.notifier_call = starlink_pmu_pm_notify;
return cpu_pm_register_notifier(&starlink_pmu->starlink_pmu_pm_nb);
static void starlink_pmu_pm_unregister(struct starlink_pmu *starlink_pmu)
cpu_pm_unregister_notifier(&starlink_pmu->starlink_pmu_pm_nb);
static void starlink_pmu_destroy(struct starlink_pmu *starlink_pmu)
starlink_pmu_pm_unregister(starlink_pmu);
&starlink_pmu->node);
struct starlink_pmu *starlink_pmu;
#define to_starlink_pmu(p) (container_of(p, struct starlink_pmu, pmu))
starlink_pmu = devm_kzalloc(&pdev->dev, sizeof(*starlink_pmu), GFP_KERNEL);
if (!starlink_pmu)
starlink_pmu->pmu_base =
if (IS_ERR(starlink_pmu->pmu_base))
return PTR_ERR(starlink_pmu->pmu_base);
starlink_pmu->hw_events = alloc_percpu_gfp(struct starlink_hw_events,
if (!starlink_pmu->hw_events) {
hw_events = per_cpu_ptr(starlink_pmu->hw_events, cpuid);
ret = starlink_setup_irqs(starlink_pmu, pdev);
&starlink_pmu->node);
ret = starlink_pmu_pm_register(starlink_pmu);
&starlink_pmu->node);
starlink_pmu->pmu = (struct pmu) {
ret = perf_pmu_register(&starlink_pmu->pmu, STARLINK_PMU_PDEV_NAME, -1);
starlink_pmu_destroy(starlink_pmu);
struct starlink_pmu *starlink_pmu = hlist_entry_safe(node,
struct starlink_pmu,
if (cpumask_empty(&starlink_pmu->cpumask))
cpumask_set_cpu(cpu, &starlink_pmu->cpumask);
WARN_ON(irq_set_affinity(starlink_pmu->irq, cpumask_of(cpu)));
struct starlink_pmu *starlink_pmu = hlist_entry_safe(node,
struct starlink_pmu,
if (!cpumask_test_and_clear_cpu(cpu, &starlink_pmu->cpumask))
perf_pmu_migrate_context(&starlink_pmu->pmu, cpu, target);
cpumask_set_cpu(target, &starlink_pmu->cpumask);
WARN_ON(irq_set_affinity(starlink_pmu->irq, cpumask_of(target)));