From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 10/11] drm/i915: don't get/put runtime PM at the debugfs forcewake file Date: Wed, 5 Mar 2014 14:41:48 +0100 Message-ID: <20140305134148.GN17001@phenom.ffwll.local> References: <1393001548-2883-1-git-send-email-przanoni@gmail.com> <1393001548-2883-11-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id ACD74FA6BD for ; Wed, 5 Mar 2014 05:41:52 -0800 (PST) Received: by mail-ea0-f169.google.com with SMTP id h14so1045937eaj.14 for ; Wed, 05 Mar 2014 05:41:51 -0800 (PST) Content-Disposition: inline In-Reply-To: <1393001548-2883-11-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Paulo Zanoni Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Fri, Feb 21, 2014 at 01:52:27PM -0300, Paulo Zanoni wrote: > From: Paulo Zanoni > > Because gen6_gt_force_wake_{get,put} should already be responsible for > getting/putting runtime PM. > > Signed-off-by: Paulo Zanoni > --- > drivers/gpu/drm/i915/i915_debugfs.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c > index 62d0c0915..2ec7b05 100644 > --- a/drivers/gpu/drm/i915/i915_debugfs.c > +++ b/drivers/gpu/drm/i915/i915_debugfs.c > @@ -3597,7 +3597,6 @@ static int i915_forcewake_open(struct inode *inode, struct file *file) > if (INTEL_INFO(dev)->gen < 6) > return 0; > > - intel_runtime_pm_get(dev_priv); > gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL); I agree that doing the runtime get/put from within the forcewake get/put gives us nice nesting. The with that is that we do the forcewake get/put from within register I/O functions, which means it's not simple at all to figure out where all runtime_pm_get is called, which can lead to some big surprises around locking (since our resume functions do a _lot_ of work). This is the reason why I've asked for the exception for the forcewake -> runtime pm nesting. We could fix this properly by moving the forcewake get/put out of the register read/write functions and sprinkle it explicitly over the code, but that's a _lot_ more work. For now I'll punt on this patch until convinced otherwise. -Daniel > > return 0; > @@ -3612,7 +3611,6 @@ static int i915_forcewake_release(struct inode *inode, struct file *file) > return 0; > > gen6_gt_force_wake_put(dev_priv, FORCEWAKE_ALL); > - intel_runtime_pm_put(dev_priv); > > return 0; > } > -- > 1.8.5.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch