From: Ben Widawsky Subject: Re: enabling forcewake from userspace Date: Sat, 26 Mar 2011 12:27:17 -0700 Message-ID: <20110326192717.GA3108@lundgren.kumite> References: <1301105269-23970-1-git-send-email-ben@bwidawsk.net> <20110326022358.GA24223@lundgren.kumite> <20110326154625.GA5068@lundgren.kumite> <0d30dc$ljrf4q@orsmga001.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id AF4709E77C for ; Sat, 26 Mar 2011 12:27:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <0d30dc$ljrf4q@orsmga001.jf.intel.com> 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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. 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. 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. > -Chris > Ben