From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: Fix runtime pm inbalance due to reg I/O forcewake dance Date: Fri, 14 Mar 2014 10:34:36 +0200 Message-ID: <20140314083436.GU20292@intel.com> References: <1394783326-10484-1-git-send-email-daniel.vetter@ffwll.ch> <20140314081847.GT20292@intel.com> <20140314082400.GB17305@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 30540FB067 for ; Fri, 14 Mar 2014 01:34:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140314082400.GB17305@nuc-i3427.alporthouse.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: Chris Wilson , Daniel Vetter , Intel Graphics Development , Ben Widawsky , Paulo Zanoni , Jesse Barnes List-Id: intel-gfx@lists.freedesktop.org On Fri, Mar 14, 2014 at 08:24:00AM +0000, Chris Wilson wrote: > On Fri, Mar 14, 2014 at 10:18:47AM +0200, Ville Syrj=E4l=E4 wrote: > > On Fri, Mar 14, 2014 at 08:48:46AM +0100, Daniel Vetter wrote: > > > This regression has been introduced in > > > = > > > commit 8232644ccf099548710843e97360a3fcd6d28e04 > > > Author: Chris Wilson > > > Date: Wed Mar 5 12:00:39 2014 +0000 > > > = > > > drm/i915: Convert the forcewake worker into a timer func > > > = > > > which started to use the delayed forcewake put also for the register > > > I/O forcewake dance. But this conflicts functionally with the > > > (reviewed in parallel) > > > = > > > commit 6d88064edcfc5e5893371f7c06b9f3078dc1edf6 > > > Author: Paulo Zanoni > > > Date: Fri Feb 21 17:58:29 2014 -0300 > > > = > > > drm/i915: put runtime PM only when we actually release force_wake > > > = > > > which moved the runtime pm put calls into the delayed forcewake put > > > function to avoid an inversion between these. The problem is that the > > > register I/O function do _not_ grab a runtime pm reference, hence > > > dropping it is a bug. > > > = > > > So split the timer into two to re-balance the runtime pm refcounting. > > > The tricky bit to ensure is that the _raw timer doesn't run after > > > we've runtime-suspended the device. After all it only has an implicit > > > runtime pm reference provided by its caller. But the del_timer_sync in > > > the runtime suspend code will ensure this. > > > = > > > Add a comment to document this all. > > = > > Yuck. Why don't we just stick the runtime pm put into > > gen6_gt_force_wake_put() and let Chris's timer cancellation + > > forcewake reset fixes take care of things? > = > Heh, I went the other way round, dropped the runtime pm put from the > timer and flushed the forcewaker timer when we suspended the device... That's what I meant. No delayed runtime_pm_put. -- = Ville Syrj=E4l=E4 Intel OTC