aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-12 08:06:44 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-12 16:59:24 -0500
commit09153000b8ca32a539a1207edebabd0d40b6c61b (patch)
treeafb797432fbb708cc2d7bdc7e18196c078ffb9e6 /drivers/gpu/drm/i915/i915_debugfs.c
parent20afbda209d708be66944907966486d0c1331cb8 (diff)
drm/i915: rework locking for intel_dpio|sbi_read|write
Spinning for up to 200 us with interrupts locked out is not good. So let's just spin (and even that seems to be excessive). And we don't call these functions from interrupt context, so this is not required. Besides that doing anything in interrupt contexts which might take a few hundred us is a no-go. So just convert the entire thing to a mutex. Also move the mutex-grabbing out of the read/write functions (add a WARN_ON(!is_locked)) instead) since all callers are nicely grouped together. Finally the real motivation for this change: Dont grab the modeset mutex in the dpio debugfs file, we don't need that consistency. And correctness of the dpio interface is ensured with the dpio_lock. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7e516eebdc80..7047c4a9fb9e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1633,7 +1633,7 @@ static int i915_dpio_info(struct seq_file *m, void *data)
1633 return 0; 1633 return 0;
1634 } 1634 }
1635 1635
1636 ret = mutex_lock_interruptible(&dev->mode_config.mutex); 1636 ret = mutex_lock_interruptible(&dev_priv->dpio_lock);
1637 if (ret) 1637 if (ret)
1638 return ret; 1638 return ret;
1639 1639
@@ -1662,7 +1662,7 @@ static int i915_dpio_info(struct seq_file *m, void *data)
1662 seq_printf(m, "DPIO_FASTCLK_DISABLE: 0x%08x\n", 1662 seq_printf(m, "DPIO_FASTCLK_DISABLE: 0x%08x\n",
1663 intel_dpio_read(dev_priv, DPIO_FASTCLK_DISABLE)); 1663 intel_dpio_read(dev_priv, DPIO_FASTCLK_DISABLE));
1664 1664
1665 mutex_unlock(&dev->mode_config.mutex); 1665 mutex_unlock(&dev_priv->dpio_lock);
1666 1666
1667 return 0; 1667 return 0;
1668} 1668}