All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: enabling forcewake from userspace
Date: Sat, 26 Mar 2011 20:20:14 +0000	[thread overview]
Message-ID: <1bdc18$k0qeku@fmsmga002.fm.intel.com> (raw)
In-Reply-To: <20110326192717.GA3108@lundgren.kumite>

On Sat, 26 Mar 2011 12:27:17 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Sat, Mar 26, 2011 at 05:18:57PM +0000, Chris Wilson wrote:
> > 
> > The GPU is definitely allowed to be powered down whilst the CPU is
> > servicing an interrupt. ;-) I take your point though that the current
> > method is not interrupt safe. However, we should not be doing such work
> > from an interrupt handler - if need be all the actual work is kicked off
> > from a workqueue.
> > 
> > Something we need to keep an eye on, but not a problem today. *touch wood*
> 
> Efficiency aside, workqueue suffers from the same hazard. Unless the
> assumption is struct_mutex (or something similar) is protecting all
> register access which are in the power wells that can get disabled.

Yes, currently we use struct mutex to serialise pretty much everything,
__gen6_gt_force_wake_* included.

> My
> quick inspection of the code shows this is probably true, but in this
> case I'd suggest a WARN_ON or something in force_wake_get(), because
> this would be a really hard bug to track down.

Similarly, a WARN_ON in i915_reg_write() if reg < 0x40000 && !force-wake.
 
> By the way, I think we currently have potential problem with
> kick_ring().  Although given when this occurs it is probably a DON'T
> CARE.

True. A task for a truly rainy day. And whilst you're there move the error
capture to a workqueue as well.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

      reply	other threads:[~2011-03-26 20:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26  2:07 enabling forcewake from userspace Ben Widawsky
2011-03-26  2:07 ` [PATCH] drm/i915: have a forcewake "refcount" Ben Widawsky
2011-03-26  2:23 ` enabling forcewake from userspace Ben Widawsky
2011-03-26  7:11   ` Chris Wilson
2011-03-26 15:46     ` Ben Widawsky
2011-03-26 17:18       ` Chris Wilson
2011-03-26 19:27         ` Ben Widawsky
2011-03-26 20:20           ` Chris Wilson [this message]

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='1bdc18$k0qeku@fmsmga002.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=ben@bwidawsk.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.