File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 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)
22012201 int bit , loops ;
22022202 u64 status ;
22032203 int handled ;
2204+ int pmu_enabled ;
22042205
22052206 cpuc = this_cpu_ptr (& cpu_hw_events );
22062207
2208+ /*
2209+ * Save the PMU state.
2210+ * It needs to be restored when leaving the handler.
2211+ */
2212+ pmu_enabled = cpuc -> enabled ;
22072213 /*
22082214 * No known reason to not always do late ACK,
22092215 * but just in case do it opt-in.
22102216 */
22112217 if (!x86_pmu .late_ack )
22122218 apic_write (APIC_LVTPC , APIC_DM_NMI );
22132219 intel_bts_disable_local ();
2220+ cpuc -> enabled = 0 ;
22142221 __intel_pmu_disable_all ();
22152222 handled = intel_pmu_drain_bts_buffer ();
22162223 handled += intel_bts_interrupt ();
@@ -2320,7 +2327,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
23202327
23212328done :
23222329 /* 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 )
23242332 __intel_pmu_enable_all (0 , true);
23252333 intel_bts_enable_local ();
23262334
You can’t perform that action at this time.
0 commit comments