[Intel-gfx] [PATCH] drm/i915: yet another forcewake lock fix

Ben Widawsky ben at bwidawsk.net
Thu Jun 16 23:36:42 CEST 2011


Resume is missing a locks on gt sleepable registers.
---
 drivers/gpu/drm/i915/i915_suspend.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 60a94d2..9259dcf 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -780,6 +780,8 @@ void i915_restore_display(struct drm_device *dev)
 		I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
 	else
 		I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
+
+	mutex_lock(&dev->struct_mutex);
 	I915_WRITE(VGA0, dev_priv->saveVGA0);
 	I915_WRITE(VGA1, dev_priv->saveVGA1);
 	I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
@@ -787,6 +789,7 @@ void i915_restore_display(struct drm_device *dev)
 	udelay(150);
 
 	i915_restore_vga(dev);
+	mutex_unlock(&dev->struct_mutex);
 }
 
 int i915_save_state(struct drm_device *dev)
-- 
1.7.5.2
-- 
I can't test this right now because I cannot resume from suspend due to my USB
harddrive not coming back for some reason. I think this should cover the case
you're hitting though.

Ben



More information about the Intel-gfx mailing list