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: Fri, 30 Mar 2012 21:05:17 +0200 Message-ID: <20120330190517.GB23526@phenom.ffwll.local> References: <1332103198-25852-1-git-send-email-ben@bwidawsk.net> <1332103198-25852-13-git-send-email-ben@bwidawsk.net> <20120329193121.GF27737@phenom.ffwll.local> <20120330115042.2b96b86a@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 312CC9E889 for ; Fri, 30 Mar 2012 12:04:34 -0700 (PDT) Received: by werp11 with SMTP id p11so670248wer.36 for ; Fri, 30 Mar 2012 12:04:33 -0700 (PDT) In-Reply-To: <20120330115042.2b96b86a@bwidawsk.net> Content-Disposition: inline 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 Fri, Mar 30, 2012 at 11:50:42AM -0700, Ben Widawsky wrote: > On Thu, 29 Mar 2012 21:31:21 +0200 > Daniel Vetter wrote: > > > 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. > > I think i915_reset does the right thing, but I'm not sure. It has a big > gen switch statement in it. Yeah, it just returns. But on reading i915_reset I think you don't want all it does - it resets the entire modeset and gem state, too. I think it would be better to just do the hw reset and not bother with everything else - the only chance is that it accidentally breaks module unload. What about extracting the actual hw reset code (i.e. the switch(gen) stuff) into i915_do_reset and only calling that? If you want, add the is_gen5 check, but given that it's just module unload I don't care about fried hw due to a not-so-well-working gpu reset ;-) -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48