aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/metag/kernel/perf/perf_event.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/metag/kernel/perf/perf_event.c b/arch/metag/kernel/perf/perf_event.c
index 5cc4d4dcf3cf..02c08737f6aa 100644
--- a/arch/metag/kernel/perf/perf_event.c
+++ b/arch/metag/kernel/perf/perf_event.c
@@ -568,16 +568,6 @@ static int _hw_perf_event_init(struct perf_event *event)
568 return -EINVAL; 568 return -EINVAL;
569 569
570 /* 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
580 /*
581 * Don't assign an index until the event is placed into the hardware. 571 * Don't assign an index until the event is placed into the hardware.
582 * -1 signifies that we're still deciding where to put it. On SMP 572 * -1 signifies that we're still deciding where to put it. On SMP
583 * systems each core has its own set of counters, so we can't do any 573 * systems each core has its own set of counters, so we can't do any
@@ -866,6 +856,15 @@ static int __init init_hw_perf_events(void)
866 pr_info("enabled with %s PMU driver, %d counters available\n", 856 pr_info("enabled with %s PMU driver, %d counters available\n",
867 metag_pmu->name, metag_pmu->max_events); 857 metag_pmu->name, metag_pmu->max_events);
868 858
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
869 /* Initialise the active events and reservation mutex */ 868 /* Initialise the active events and reservation mutex */
870 atomic_set(&metag_pmu->active_events, 0); 869 atomic_set(&metag_pmu->active_events, 0);
871 mutex_init(&metag_pmu->reserve_mutex); 870 mutex_init(&metag_pmu->reserve_mutex);