@@ -268,10 +268,8 @@ static inline void armv6pmu_write_counter(struct perf_event *event, u64 value)
268268
269269static void armv6pmu_enable_event (struct perf_event * event )
270270{
271- unsigned long val , mask , evt , flags ;
272- struct arm_pmu * cpu_pmu = to_arm_pmu (event -> pmu );
271+ unsigned long val , mask , evt ;
273272 struct hw_perf_event * hwc = & event -> hw ;
274- struct pmu_hw_events * events = this_cpu_ptr (cpu_pmu -> hw_events );
275273 int idx = hwc -> idx ;
276274
277275 if (ARMV6_CYCLE_COUNTER == idx ) {
@@ -294,12 +292,10 @@ static void armv6pmu_enable_event(struct perf_event *event)
294292 * Mask out the current event and set the counter to count the event
295293 * that we're interested in.
296294 */
297- raw_spin_lock_irqsave (& events -> pmu_lock , flags );
298295 val = armv6_pmcr_read ();
299296 val &= ~mask ;
300297 val |= evt ;
301298 armv6_pmcr_write (val );
302- raw_spin_unlock_irqrestore (& events -> pmu_lock , flags );
303299}
304300
305301static irqreturn_t
@@ -362,26 +358,20 @@ armv6pmu_handle_irq(struct arm_pmu *cpu_pmu)
362358
363359static void armv6pmu_start (struct arm_pmu * cpu_pmu )
364360{
365- unsigned long flags , val ;
366- struct pmu_hw_events * events = this_cpu_ptr (cpu_pmu -> hw_events );
361+ unsigned long val ;
367362
368- raw_spin_lock_irqsave (& events -> pmu_lock , flags );
369363 val = armv6_pmcr_read ();
370364 val |= ARMV6_PMCR_ENABLE ;
371365 armv6_pmcr_write (val );
372- raw_spin_unlock_irqrestore (& events -> pmu_lock , flags );
373366}
374367
375368static void armv6pmu_stop (struct arm_pmu * cpu_pmu )
376369{
377- unsigned long flags , val ;
378- struct pmu_hw_events * events = this_cpu_ptr (cpu_pmu -> hw_events );
370+ unsigned long val ;
379371
380- raw_spin_lock_irqsave (& events -> pmu_lock , flags );
381372 val = armv6_pmcr_read ();
382373 val &= ~ARMV6_PMCR_ENABLE ;
383374 armv6_pmcr_write (val );
384- raw_spin_unlock_irqrestore (& events -> pmu_lock , flags );
385375}
386376
387377static int
@@ -419,10 +409,8 @@ static void armv6pmu_clear_event_idx(struct pmu_hw_events *cpuc,
419409
420410static void armv6pmu_disable_event (struct perf_event * event )
421411{
422- unsigned long val , mask , evt , flags ;
423- struct arm_pmu * cpu_pmu = to_arm_pmu (event -> pmu );
412+ unsigned long val , mask , evt ;
424413 struct hw_perf_event * hwc = & event -> hw ;
425- struct pmu_hw_events * events = this_cpu_ptr (cpu_pmu -> hw_events );
426414 int idx = hwc -> idx ;
427415
428416 if (ARMV6_CYCLE_COUNTER == idx ) {
@@ -444,20 +432,16 @@ static void armv6pmu_disable_event(struct perf_event *event)
444432 * of ETM bus signal assertion cycles. The external reporting should
445433 * be disabled and so this should never increment.
446434 */
447- raw_spin_lock_irqsave (& events -> pmu_lock , flags );
448435 val = armv6_pmcr_read ();
449436 val &= ~mask ;
450437 val |= evt ;
451438 armv6_pmcr_write (val );
452- raw_spin_unlock_irqrestore (& events -> pmu_lock , flags );
453439}
454440
455441static void armv6mpcore_pmu_disable_event (struct perf_event * event )
456442{
457- unsigned long val , mask , flags , evt = 0 ;
458- struct arm_pmu * cpu_pmu = to_arm_pmu (event -> pmu );
443+ unsigned long val , mask , evt = 0 ;
459444 struct hw_perf_event * hwc = & event -> hw ;
460- struct pmu_hw_events * events = this_cpu_ptr (cpu_pmu -> hw_events );
461445 int idx = hwc -> idx ;
462446
463447 if (ARMV6_CYCLE_COUNTER == idx ) {
@@ -475,12 +459,10 @@ static void armv6mpcore_pmu_disable_event(struct perf_event *event)
475459 * Unlike UP ARMv6, we don't have a way of stopping the counters. We
476460 * simply disable the interrupt reporting.
477461 */
478- raw_spin_lock_irqsave (& events -> pmu_lock , flags );
479462 val = armv6_pmcr_read ();
480463 val &= ~mask ;
481464 val |= evt ;
482465 armv6_pmcr_write (val );
483- raw_spin_unlock_irqrestore (& events -> pmu_lock , flags );
484466}
485467
486468static int armv6_map_event (struct perf_event * event )
0 commit comments