@@ -71,11 +71,7 @@ static inline void pmu_irq_stats(struct drm_i915_private *i915,
if (unlikely(res != IRQ_HANDLED))
return;
- /*
- * A clever compiler translates that into INC. A not so clever one
- * should at least prevent store tearing.
- */
- WRITE_ONCE(i915->pmu.irq_count, i915->pmu.irq_count + 1);
+ i915_pmu_irq(i915);
}
void gen3_irq_reset(struct intel_uncore *uncore, i915_reg_t imr,
@@ -1348,3 +1348,12 @@ void i915_pmu_unregister(struct drm_i915_private *i915)
kfree(pmu->name);
free_event_attributes(pmu);
}
+
+void i915_pmu_irq(struct drm_i915_private *i915)
+{
+ /*
+ * A clever compiler translates that into INC. A not so clever one
+ * should at least prevent store tearing.
+ */
+ WRITE_ONCE(i915->pmu.irq_count, i915->pmu.irq_count + 1);
+}
@@ -159,6 +159,7 @@ int i915_pmu_init(void);
void i915_pmu_exit(void);
void i915_pmu_register(struct drm_i915_private *i915);
void i915_pmu_unregister(struct drm_i915_private *i915);
+void i915_pmu_irq(struct drm_i915_private *i915);
void i915_pmu_gt_parked(struct intel_gt *gt);
void i915_pmu_gt_unparked(struct intel_gt *gt);
#else
@@ -166,6 +167,7 @@ static inline int i915_pmu_init(void) { return 0; }
static inline void i915_pmu_exit(void) {}
static inline void i915_pmu_register(struct drm_i915_private *i915) {}
static inline void i915_pmu_unregister(struct drm_i915_private *i915) {}
+static inline void i915_pmu_irq(struct drm_i915_private *i915) {}
static inline void i915_pmu_gt_parked(struct intel_gt *gt) {}
static inline void i915_pmu_gt_unparked(struct intel_gt *gt) {}
#endif
Avoid accessing PMU details directly from irq code. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/i915_irq.c | 6 +----- drivers/gpu/drm/i915/i915_pmu.c | 9 +++++++++ drivers/gpu/drm/i915/i915_pmu.h | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-)