From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH v2 1/2] drm/i915: fix possible refcount leak when resetting forcewake Date: Fri, 06 Jun 2014 21:38:26 +0300 Message-ID: <1402079906.4193.11.camel@ideak-mobl> References: <1402048779-14902-1-git-send-email-imre.deak@intel.com> <1402052677-19607-1-git-send-email-imre.deak@intel.com> <20140606110843.GF22214@nuc-i3427.alporthouse.com> <20140606174619.GS7416@phenom.ffwll.local> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id A560B6EAB6 for ; Fri, 6 Jun 2014 11:38:41 -0700 (PDT) In-Reply-To: <20140606174619.GS7416@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 2014-06-06 at 19:46 +0200, Daniel Vetter wrote: > On Fri, Jun 06, 2014 at 12:08:43PM +0100, Chris Wilson wrote: > > On Fri, Jun 06, 2014 at 02:04:37PM +0300, Imre Deak wrote: > > > If the timer putting the last forcewake refcount was pending and we > > > canceled it, we'll leak the corresponding forcewake and RPM references. > > > > > > v2: > > > - do the ptr casting at the caller instead of adding a separate helper > > > for this (Chris) > > > > > > Signed-off-by: Imre Deak > > Reviewed-by: Chris Wilson > > Both patches merged to dinq (Chris clarified on irc that his r-b is for > both). > > Since this only blows up in a super-contrived testcase I don't > think this is material for -fixes. Note that the issue fixed by 1/2 could also happen normally, though the window for race is small. One scenario would be runtime resume ->deferred rps_enable followed directly by system suspend or gpu reset. --Imre