From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH] drm/i915: Only unlink ggtt->global_link after i915_gem_load Date: Fri, 10 Jan 2014 12:22:44 -0800 Message-ID: <20140110202243.GC11277@bwidawsk.net> References: <1387195267-7749-1-git-send-email-chris@chris-wilson.co.uk> <20131216185820.GF5054@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 746AD106AE3 for ; Fri, 10 Jan 2014 12:22:56 -0800 (PST) Content-Disposition: inline In-Reply-To: <20131216185820.GF5054@nuc-i3427.alporthouse.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 , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Dec 16, 2013 at 06:58:20PM +0000, Chris Wilson wrote: > On Mon, Dec 16, 2013 at 12:01:07PM +0000, Chris Wilson wrote: > > If i915_driver_load fails before i915_gem_load we try to unlink the ggtt > > prior to initialising the list and triggering an oops. > > This is incomplete. > > > Signed-off-by: Chris Wilson > > --- > > drivers/gpu/drm/i915/i915_dma.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c > > index df1410ecbb8b..6364c503f97d 100644 > > --- a/drivers/gpu/drm/i915/i915_dma.c > > +++ b/drivers/gpu/drm/i915/i915_dma.c > > @@ -1683,11 +1683,11 @@ out_gem_unload: > > intel_teardown_gmbus(dev); > > intel_teardown_mchbar(dev); > > destroy_workqueue(dev_priv->wq); > > + list_del(&dev_priv->gtt.base.global_link); This is correct. > + dev_priv->gtt.base.cleanup(&dev_priv->gtt.base); I'm not convinced here. It should be safe [ideal] to call cleanup after we've setup the function pointer, which would be out_gtt; it's done in i915_gem_gtt_init(). If it's not safe to call for some reason, we should fix cleanup() > > out_mtrrfree: > > arch_phys_wc_del(dev_priv->gtt.mtrr); > > io_mapping_free(dev_priv->gtt.mappable); > > out_gtt: > > - list_del(&dev_priv->gtt.base.global_link); > - drm_mm_takedown(&dev_priv->gtt.base.mm); This is correct. > - dev_priv->gtt.base.cleanup(&dev_priv->gtt.base); > > -- > Chris Wilson, Intel Open Source Technology Centre -- Ben Widawsky, Intel Open Source Technology Center