Skip to content

Commit 1b92722

Browse files
deateringomolnar
authored andcommitted
metag, perf: Use common PMU interrupt disabled code
Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for failing a sampling event when no PMU interrupt is available. Signed-off-by: Vince Weaver <vincent.weaver@maine.edu> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: linux-metag@vger.kernel.org Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1406150202050.16738@vincent-weaver-1.umelst.maine.edu Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 6e316f9 commit 1b92722

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

‎arch/metag/kernel/perf/perf_event.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,16 +567,6 @@ static int _hw_perf_event_init(struct perf_event *event)
567567
if (mapping == -1)
568568
return -EINVAL;
569569

570-
/*
571-
* Early cores have "limited" counters - they have no overflow
572-
* interrupts - and so are unable to do sampling without extra work
573-
* and timer assistance.
574-
*/
575-
if (metag_pmu->max_period == 0) {
576-
if (hwc->sample_period)
577-
return -EINVAL;
578-
}
579-
580570
/*
581571
* Don't assign an index until the event is placed into the hardware.
582572
* -1 signifies that we're still deciding where to put it. On SMP
@@ -866,6 +856,15 @@ static int __init init_hw_perf_events(void)
866856
pr_info("enabled with %s PMU driver, %d counters available\n",
867857
metag_pmu->name, metag_pmu->max_events);
868858

859+
/*
860+
* Early cores have "limited" counters - they have no overflow
861+
* interrupts - and so are unable to do sampling without extra work
862+
* and timer assistance.
863+
*/
864+
if (metag_pmu->max_period == 0) {
865+
metag_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
866+
}
867+
869868
/* Initialise the active events and reservation mutex */
870869
atomic_set(&metag_pmu->active_events, 0);
871870
mutex_init(&metag_pmu->reserve_mutex);

0 commit comments

Comments
 (0)