From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH] drm/i915: fix locking around punit access in cur_delayinfo for VLV Date: Tue, 23 Apr 2013 10:51:28 +0300 Message-ID: <8761zdznun.fsf@intel.com> References: <1366671570-11524-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id E6EF6E6071 for ; Tue, 23 Apr 2013 00:51:15 -0700 (PDT) In-Reply-To: <1366671570-11524-1-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 23 Apr 2013, Jesse Barnes wrote: > We need to hold the rps lock around punit access. Reviewed-by: Jani Nikula And a semi-related question while at it... we will need punit access also for non-rps stuff. Shall we just bundle them under the semantically wrong rps lock? It would also feel a bit awkward to add another level of locking for punit when we already have a "hw_lock" in rps. BR, Jani. > Reported-by: Kenneth Graunke > Signed-off-by: Jesse Barnes > --- > drivers/gpu/drm/i915/i915_debugfs.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c > index 367b534..d195d09 100644 > --- a/drivers/gpu/drm/i915/i915_debugfs.c > +++ b/drivers/gpu/drm/i915/i915_debugfs.c > @@ -1012,6 +1012,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) > } else if (IS_VALLEYVIEW(dev)) { > u32 freq_sts, val; > > + mutex_lock(&dev_priv->rps.hw_lock); > valleyview_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS, > &freq_sts); > seq_printf(m, "PUNIT_REG_GPU_FREQ_STS: 0x%08x\n", freq_sts); > @@ -1028,6 +1029,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) > seq_printf(m, "current GPU freq: %d MHz\n", > vlv_gpu_freq(dev_priv->mem_freq, > (freq_sts >> 8) & 0xff)); > + mutex_unlock(&dev_priv->rps.hw_lock); > } else { > seq_printf(m, "no P-state info available\n"); > } > -- > 1.7.10.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx