From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 12/18] drm/i915: try to reset the gpu before unload Date: Thu, 29 Mar 2012 21:31:21 +0200 Message-ID: <20120329193121.GF27737@phenom.ffwll.local> References: <1332103198-25852-1-git-send-email-ben@bwidawsk.net> <1332103198-25852-13-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 8274F9E78C for ; Thu, 29 Mar 2012 12:30:38 -0700 (PDT) Received: by wibhj13 with SMTP id hj13so322083wib.12 for ; Thu, 29 Mar 2012 12:30:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1332103198-25852-13-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Mar 18, 2012 at 01:39:52PM -0700, Ben Widawsky wrote: > paranoia > > For context support the HW expects the default context to always be > available as there is no way to shut off HW contexts once turned on > (afaics). This is problematic when unloading the driver as we have no > way to prevent the GPU from expecting the BO to still be present once > unloaded. > > The best we can do to remedy the situation is to attempt a GPU reset > when doing the unload. > > NOTE: this patch isn't *really* required to go with the rest of the > context serious. > > Signed-off-by: Ben Widawsky I think the paranoia here is justified (albeit it would benefit from some commit-message love imo). But we do not support i915_reset on all gens, so I think you need to add a gen >= 5 check here. > --- > drivers/gpu/drm/i915/i915_gem.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index c1aab45..848cc45 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -3910,6 +3910,9 @@ i915_gem_lastclose(struct drm_device *dev) > ret = i915_gem_idle(dev); > if (ret) > DRM_ERROR("failed to idle hardware: %d\n", ret); > + ret = i915_reset(dev, GRDOM_FULL); > + if (ret) > + DRM_ERROR("failed to reset gpu: %d\n", ret); > } > > static void > -- > 1.7.9.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48