@@ -6276,7 +6276,27 @@ static u32 intel_rps_limits(struct drm_i915_private *dev_priv, u8 val)
* frequency, if the down threshold expires in that window we will not
* receive a down interrupt. */
if (INTEL_GEN(dev_priv) >= 9) {
- limits = (rps->max_freq_softlimit) << 23;
+ int max_freq = rps->max_freq_softlimit;
+ int rp0_freq = rps->rp0_freq;
+
+ if (IS_GEN9_LP(dev_priv) && (max_freq == rp0_freq))
+ /* For GEN9_LP, the HW seems insensitive to the RP FUp
+ * interrupt limiter threshold by design. This symptom
+ * is experienced in the IGT test (pm_rps): when the
+ * test sets the max_freq back to RP0, the interrupt
+ * limits register is also programmed to the max_freq
+ * per design. But as a result, the actual freq is not
+ * the max_freq detected. It is suggested (based on the
+ * best test/tuning practice) to increase the upper
+ * interrupt limiter just by 1 (16.6MHz) so that the HW
+ * will generate an interrupt when we are near or just
+ * below the upper limit.
+ */
+
+ limits = (rps->max_freq_softlimit + 1) << 23;
+ else
+ limits = (rps->max_freq_softlimit) << 23;
+
if (val <= rps->min_freq_softlimit)
limits |= (rps->min_freq_softlimit) << 14;
} else {