|
@@ -8388,6 +8388,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
|
|
|
const i915_reg_t reg)
|
|
|
{
|
|
|
u32 lower, upper, tmp;
|
|
|
+ int loop = 2;
|
|
|
|
|
|
/* The register accessed do not need forcewake. We borrow
|
|
|
* uncore lock to prevent concurrent access to range reg.
|
|
@@ -8416,7 +8417,7 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
|
|
|
I915_WRITE_FW(VLV_COUNTER_CONTROL,
|
|
|
_MASKED_BIT_ENABLE(VLV_COUNT_RANGE_HIGH));
|
|
|
upper = I915_READ_FW(reg);
|
|
|
- } while (upper != tmp);
|
|
|
+ } while (upper != tmp && --loop);
|
|
|
|
|
|
/* Everywhere else we always use VLV_COUNTER_CONTROL with the
|
|
|
* VLV_COUNT_RANGE_HIGH bit set - so it is safe to leave it set
|