From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: enabling forcewake from userspace Date: Sat, 26 Mar 2011 20:20:14 +0000 Message-ID: <1bdc18$k0qeku@fmsmga002.fm.intel.com> References: <1301105269-23970-1-git-send-email-ben@bwidawsk.net> <20110326022358.GA24223@lundgren.kumite> <20110326154625.GA5068@lundgren.kumite> <0d30dc$ljrf4q@orsmga001.jf.intel.com> <20110326192717.GA3108@lundgren.kumite> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 794B09E7AE for ; Sat, 26 Mar 2011 13:20:17 -0700 (PDT) In-Reply-To: <20110326192717.GA3108@lundgren.kumite> 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: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, 26 Mar 2011 12:27:17 -0700, Ben Widawsky 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