File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2201,16 +2201,23 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
2201
2201
int bit , loops ;
2202
2202
u64 status ;
2203
2203
int handled ;
2204
+ int pmu_enabled ;
2204
2205
2205
2206
cpuc = this_cpu_ptr (& cpu_hw_events );
2206
2207
2208
+ /*
2209
+ * Save the PMU state.
2210
+ * It needs to be restored when leaving the handler.
2211
+ */
2212
+ pmu_enabled = cpuc -> enabled ;
2207
2213
/*
2208
2214
* No known reason to not always do late ACK,
2209
2215
* but just in case do it opt-in.
2210
2216
*/
2211
2217
if (!x86_pmu .late_ack )
2212
2218
apic_write (APIC_LVTPC , APIC_DM_NMI );
2213
2219
intel_bts_disable_local ();
2220
+ cpuc -> enabled = 0 ;
2214
2221
__intel_pmu_disable_all ();
2215
2222
handled = intel_pmu_drain_bts_buffer ();
2216
2223
handled += intel_bts_interrupt ();
@@ -2320,7 +2327,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
2320
2327
2321
2328
done :
2322
2329
/* Only restore PMU state when it's active. See x86_pmu_disable(). */
2323
- if (cpuc -> enabled )
2330
+ cpuc -> enabled = pmu_enabled ;
2331
+ if (pmu_enabled )
2324
2332
__intel_pmu_enable_all (0 , true);
2325
2333
intel_bts_enable_local ();
2326
2334
You can’t perform that action at this time.
0 commit comments