Subject: [PATCH -tip] perf, x86: P4 PMU - Add missing read of a counter before test
From: Don Zickus <[email-masked]>

The read of real MSR register was missed before
if () clause which leads that test never success.

Signed-off-by: Don Zickus <[email-masked]>
Signed-off-by: Cyrill Gorcunov <[email-masked]>
---
 arch/x86/kernel/cpu/perf_event_p4.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.tip/arch/x86/kernel/cpu/perf_event_p4.c
===================================================================
--- linux-2.6.tip.orig/arch/x86/kernel/cpu/perf_event_p4.c
+++ linux-2.6.tip/arch/x86/kernel/cpu/perf_event_p4.c
@@ -777,6 +777,7 @@ static inline int p4_pmu_clear_cccr_ovf(
 	 * the counter has reached zero value and continued counting before
 	 * real NMI signal was received:
 	 */
+	rdmsrl(hwc->event_base, v);
 	if (!(v & ARCH_P4_UNFLAGGED_BIT))
 		return 1;