drm/i915: Hold pc8 lock around toggling pc8.gpu_idle

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:11 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=be1c1fe21b3a9d48580bdf976c8dac844f456290
Commit:     be1c1fe21b3a9d48580bdf976c8dac844f456290
Parent:     1d37b689b1c07c01101534e55ffcd43f69069355
Author:     Chris Wilson <chris at chris-wilson.co.uk>
AuthorDate: Mon Nov 18 18:32:36 2013 -0800
Committer:  Daniel Vetter <daniel.vetter at ffwll.ch>
CommitDate: Tue Nov 19 13:03:38 2013 +0100

    drm/i915: Hold pc8 lock around toggling pc8.gpu_idle
    
    We need to hold the pc8 lock around toggling the value of gpu_idle.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
    Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi at gmail.com>
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index de6edd0..0b77916 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6585,18 +6585,22 @@ done:
 
 static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv)
 {
+	mutex_lock(&dev_priv->pc8.lock);
 	if (!dev_priv->pc8.gpu_idle) {
 		dev_priv->pc8.gpu_idle = true;
-		hsw_enable_package_c8(dev_priv);
+		__hsw_enable_package_c8(dev_priv);
 	}
+	mutex_unlock(&dev_priv->pc8.lock);
 }
 
 static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv)
 {
+	mutex_lock(&dev_priv->pc8.lock);
 	if (dev_priv->pc8.gpu_idle) {
 		dev_priv->pc8.gpu_idle = false;
-		hsw_disable_package_c8(dev_priv);
+		__hsw_disable_package_c8(dev_priv);
 	}
+	mutex_unlock(&dev_priv->pc8.lock);
 }
 
 #define for_each_power_domain(domain, mask)				\



More information about the linux-mtd-cvs mailing list