@@ -317,8 +317,9 @@ static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
{
struct drm_i915_private *dev_priv = dev->dev_private;
unsigned long irqflags;
+ int pending;
- del_timer_sync(&dev_priv->uncore.force_wake_timer);
+ pending = del_timer_sync(&dev_priv->uncore.force_wake_timer);
/* Hold uncore.lock across reset to prevent any register access
* with forcewake not set correctly
@@ -336,6 +337,8 @@ static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
if (restore) { /* If reset with a user forcewake, try to restore */
unsigned fw = 0;
+ dev_priv->uncore.forcewake_count -= pending;
+
if (IS_VALLEYVIEW(dev)) {
if (dev_priv->uncore.fw_rendercount)
fw |= FORCEWAKE_RENDER;