File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1355,9 +1355,20 @@ static void power_pmu_disable(struct pmu *pmu)
1355
1355
* Otherwise provide a warning if there is PMI pending, but
1356
1356
* no counter is found overflown.
1357
1357
*/
1358
- if (any_pmc_overflown (cpuhw ))
1359
- clear_pmi_irq_pending ();
1360
- else
1358
+ if (any_pmc_overflown (cpuhw )) {
1359
+ /*
1360
+ * Since power_pmu_disable runs under local_irq_save, it
1361
+ * could happen that code hits a PMC overflow without PMI
1362
+ * pending in paca. Hence only clear PMI pending if it was
1363
+ * set.
1364
+ *
1365
+ * If a PMI is pending, then MSR[EE] must be disabled (because
1366
+ * the masked PMI handler disabling EE). So it is safe to
1367
+ * call clear_pmi_irq_pending().
1368
+ */
1369
+ if (pmi_irq_pending ())
1370
+ clear_pmi_irq_pending ();
1371
+ } else
1361
1372
WARN_ON (pmi_irq_pending ());
1362
1373
1363
1374
val = mmcra = cpuhw -> mmcr .mmcra ;
You can’t perform that action at this time.
0 commit comments