All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dieter Mummenschanz" <mummenschanz@gmx.net>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: forcewake warning fixes in debugfs
Date: Thu, 06 Oct 2011 19:58:12 +0200	[thread overview]
Message-ID: <20111006175812.101400@gmx.net> (raw)
In-Reply-To: <201919764.351482.1317923658800.JavaMail.fmail@mwmweb004>

Hello,

I also have the same problem and would like to try the patch. Where can I find the git source repository where I can get the latest development sources?

Regards
Dieter


> -----Ursprüngliche Nachricht-----
> Von: "Ben Widawsky" <ben@bwidawsk.net>
> Gesendet: Oct 5, 2011 8:44:54 PM
> An: intel-gfx@lists.freedesktop.org
> Betreff: [PATCH] drm/i915: forcewake warning fixes in debugfs
> 
> >Some more unsafe debugfs access are fixed with this patch. I tested all
> reads,
> >but didn't thoroughly test the writes.
> >
> >Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> >---
> > drivers/gpu/drm/i915/i915_debugfs.c | 57
> +++++++++++++++++++++++++++++++----
> > 1 files changed, 51 insertions(+), 6 deletions(-)
> >---
> >Can you please try this patch to see if it helps?
> >
> >
> >diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c
> >index 3c395a5..de233df 100644
> >--- a/drivers/gpu/drm/i915/i915_debugfs.c
> >+++ b/drivers/gpu/drm/i915/i915_debugfs.c
> >@@ -635,11 +635,16 @@ static int i915_ringbuffer_info(struct seq_file *m,
> void *data)
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> > struct intel_ring_buffer *ring;
> >+ int ret;
> >
> > ring = &dev_priv->ring[(uintptr_t)node->info_ent->data];
> > if (ring->size == 0)
> > return 0;
> >
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >+
> > seq_printf(m, "Ring %s:\n", ring->name);
> > seq_printf(m, " Head : %08x\n", I915_READ_HEAD(ring) & HEAD_ADDR);
> > seq_printf(m, " Tail : %08x\n", I915_READ_TAIL(ring) & TAIL_ADDR);
> >@@ -653,6 +658,8 @@ static int i915_ringbuffer_info(struct seq_file *m,
> void *data)
> > seq_printf(m, " Control : %08x\n", I915_READ_CTL(ring));
> > seq_printf(m, " Start : %08x\n", I915_READ_START(ring));
> >
> >+ mutex_unlock(&dev->struct_mutex);
> >+
> > return 0;
> > }
> >
> >@@ -841,7 +848,16 @@ static int i915_rstdby_delays(struct seq_file *m,
> void *unused)
> > struct drm_info_node *node = (struct drm_info_node *) m->private;
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> >- u16 crstanddelay = I915_READ16(CRSTANDVID);
> >+ u16 crstanddelay;
> >+ int ret;
> >+
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >+
> >+ crstanddelay = I915_READ16(CRSTANDVID);
> >+
> >+ mutex_unlock(&dev->struct_mutex);
> >
> > seq_printf(m, "w/ctx: %d, w/o ctx: %d\n", (crstanddelay >> 8) & 0x3f,
> (crstanddelay & 0x3f));
> >
> >@@ -939,7 +955,11 @@ static int i915_delayfreq_table(struct seq_file *m,
> void *unused)
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> > u32 delayfreq;
> >- int i;
> >+ int ret, i;
> >+
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >
> > for (i = 0; i < 16; i++) {
> > delayfreq = I915_READ(PXVFREQ_BASE + i * 4);
> >@@ -947,6 +967,8 @@ static int i915_delayfreq_table(struct seq_file *m,
> void *unused)
> > (delayfreq & PXVFREQ_PX_MASK) >> PXVFREQ_PX_SHIFT);
> > }
> >
> >+ mutex_unlock(&dev->struct_mutex);
> >+
> > return 0;
> > }
> >
> >@@ -961,13 +983,19 @@ static int i915_inttoext_table(struct seq_file *m,
> void *unused)
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> > u32 inttoext;
> >- int i;
> >+ int ret, i;
> >+
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >
> > for (i = 1; i <= 32; i++) {
> > inttoext = I915_READ(INTTOEXT_BASE_ILK + i * 4);
> > seq_printf(m, "INTTOEXT%02d: 0x%08x\n", i, inttoext);
> > }
> >
> >+ mutex_unlock(&dev->struct_mutex);
> >+
> > return 0;
> > }
> >
> >@@ -976,9 +1004,19 @@ static int i915_drpc_info(struct seq_file *m, void
> *unused)
> > struct drm_info_node *node = (struct drm_info_node *) m->private;
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> >- u32 rgvmodectl = I915_READ(MEMMODECTL);
> >- u32 rstdbyctl = I915_READ(RSTDBYCTL);
> >- u16 crstandvid = I915_READ16(CRSTANDVID);
> >+ u32 rgvmodectl, rstdbyctl;
> >+ u16 crstandvid;
> >+ int ret;
> >+
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >+
> >+ rgvmodectl = I915_READ(MEMMODECTL);
> >+ rstdbyctl = I915_READ(RSTDBYCTL);
> >+ crstandvid = I915_READ16(CRSTANDVID);
> >+
> >+ mutex_unlock(&dev->struct_mutex);
> >
> > seq_printf(m, "HD boost: %s\n", (rgvmodectl & MEMMODE_BOOST_EN) ?
> > "yes" : "no");
> >@@ -1166,9 +1204,16 @@ static int i915_gfxec(struct seq_file *m, void
> *unused)
> > struct drm_info_node *node = (struct drm_info_node *) m->private;
> > struct drm_device *dev = node->minor->dev;
> > drm_i915_private_t *dev_priv = dev->dev_private;
> >+ int ret;
> >+
> >+ ret = mutex_lock_interruptible(&dev->struct_mutex);
> >+ if (ret)
> >+ return ret;
> >
> > seq_printf(m, "GFXEC: %ld\n", (unsigned long)I915_READ(0x112f4));
> >
> >+ mutex_unlock(&dev->struct_mutex);
> >+
> > return 0;
> > }
> >
> >--
> >1.7.7

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

       reply	other threads:[~2011-10-06 17:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201919764.351482.1317923658800.JavaMail.fmail@mwmweb004>
2011-10-06 17:58 ` Dieter Mummenschanz [this message]
2011-10-08 21:25   ` [PATCH] drm/i915: forcewake warning fixes in debugfs Ben Widawsky
2011-10-05  7:27 gen6_gt_force_wake issue Nicolas Kalkhof
2011-10-05 18:44 ` [PATCH] drm/i915: forcewake warning fixes in debugfs Ben Widawsky
2011-10-08 21:32   ` Daniel Vetter
2011-10-23 10:13     ` Daniel Vetter
2011-10-23 19:21       ` Keith Packard
2011-10-23 20:25         ` Ben Widawsky
2011-11-03 16:23       ` Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111006175812.101400@gmx.net \
    --to=mummenschanz@gmx.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.