aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/perf_event_p4.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
index b1f532d1d36f..ca40180c41d4 100644
--- a/arch/x86/kernel/cpu/perf_event_p4.c
+++ b/arch/x86/kernel/cpu/perf_event_p4.c
@@ -421,7 +421,8 @@ static u64 p4_pmu_event_map(int hw_event)
421 421
422static int p4_hw_config(struct perf_event *event) 422static int p4_hw_config(struct perf_event *event)
423{ 423{
424 int cpu = raw_smp_processor_id(); 424 int cpu = get_cpu();
425 int rc = 0;
425 u32 escr, cccr; 426 u32 escr, cccr;
426 427
427 /* 428 /*
@@ -454,7 +455,10 @@ static int p4_hw_config(struct perf_event *event)
454 p4_config_pack_cccr(P4_CCCR_MASK_HT)); 455 p4_config_pack_cccr(P4_CCCR_MASK_HT));
455 } 456 }
456 457
457 return x86_setup_perfctr(event); 458 rc = x86_setup_perfctr(event);
459 put_cpu();
460
461 return rc;
458} 462}
459 463
460static inline void p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) 464static inline void p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)