diff mbox

drm/i915: Remove unneeded struct_mutex around rpm

Message ID 20170218150050.10414-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Feb. 18, 2017, 3 p.m. UTC
We don't need struct_mutex for acquiring an rpm wakeref, and do not need
to serialise those register read (it's the wrong mutex for those
registers in any case). Begone!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Szwichtenberg, Radoslaw Feb. 20, 2017, 8:36 a.m. UTC | #1
On Sat, 2017-02-18 at 15:00 +0000, Chris Wilson wrote:
> We don't need struct_mutex for acquiring an rpm wakeref, and do not need

> to serialise those register read (it's the wrong mutex for those

> registers in any case). Begone!

> 

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Chris Wilson Feb. 20, 2017, 10:22 a.m. UTC | #2
On Mon, Feb 20, 2017 at 08:36:31AM +0000, Szwichtenberg, Radoslaw wrote:
> On Sat, 2017-02-18 at 15:00 +0000, Chris Wilson wrote:
> > We don't need struct_mutex for acquiring an rpm wakeref, and do not need
> > to serialise those register read (it's the wrong mutex for those
> > registers in any case). Begone!
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>

Applied, thanks.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index c0bc922fe497..9f0d8abe1e99 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1107,7 +1107,6 @@  DEFINE_SIMPLE_ATTRIBUTE(i915_next_seqno_fops,
 static int i915_frequency_info(struct seq_file *m, void *unused)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct drm_device *dev = &dev_priv->drm;
 	int ret = 0;
 
 	intel_runtime_pm_get(dev_priv);
@@ -1170,10 +1169,6 @@  static int i915_frequency_info(struct seq_file *m, void *unused)
 		}
 
 		/* RPSTAT1 is in the GT power well */
-		ret = mutex_lock_interruptible(&dev->struct_mutex);
-		if (ret)
-			goto out;
-
 		intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
 
 		reqf = I915_READ(GEN6_RPNSWREQ);
@@ -1208,7 +1203,6 @@  static int i915_frequency_info(struct seq_file *m, void *unused)
 		cagf = intel_gpu_freq(dev_priv, cagf);
 
 		intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
-		mutex_unlock(&dev->struct_mutex);
 
 		if (IS_GEN6(dev_priv) || IS_GEN7(dev_priv)) {
 			pm_ier = I915_READ(GEN6_PMIER);
@@ -1298,7 +1292,6 @@  static int i915_frequency_info(struct seq_file *m, void *unused)
 	seq_printf(m, "Max CD clock frequency: %d kHz\n", dev_priv->max_cdclk_freq);
 	seq_printf(m, "Max pixel clock frequency: %d kHz\n", dev_priv->max_dotclk_freq);
 
-out:
 	intel_runtime_pm_put(dev_priv);
 	return ret;
 }