From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 4/5] drm/i915: properly SIGBUS on I/O errors Date: Wed, 4 Jul 2012 22:40:28 +0200 Message-ID: <20120704204028.GH5375@phenom.ffwll.local> References: <1341433123-23055-1-git-send-email-daniel.vetter@ffwll.ch> <1341433123-23055-5-git-send-email-daniel.vetter@ffwll.ch> 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 87D6F9E7C2 for ; Wed, 4 Jul 2012 13:40:32 -0700 (PDT) Received: by werb13 with SMTP id b13so2874940wer.36 for ; Wed, 04 Jul 2012 13:40:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1341433123-23055-5-git-send-email-daniel.vetter@ffwll.ch> 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: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Wed, Jul 04, 2012 at 10:18:42PM +0200, Daniel Vetter wrote: > ... instead of looping endless with no hope of ever serving that > page-fault. We only need to break out of this loop when the gpu died, > to run the reset work (and hopefully resurrect it). To clarify questions Chris raised on irc: This is about handling I/O errors not from our own code, but e.g. when the disk died when trying to swap in a gem bo. So this patch remidies the issue that the current handling only handles gpu-death-induced cases of -EIO. Admittedly, dying disks are much rarer than hanging gpus ... I'll add that blurb to the commit. -Daniel > > This seems to have been lost in: > > commit d9bc7e9f32716901c617e1f0fb6ce0f74f172686 > Author: Chris Wilson > Date: Mon Feb 7 13:09:31 2011 +0000 > > drm/i915: Fix infinite loop regression from 21dd3734 > > Signed-Off-by: Daniel Vetter > --- > drivers/gpu/drm/i915/i915_gem.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index 7d28555..2b54142 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -1141,6 +1141,11 @@ unlock: > out: > switch (ret) { > case -EIO: > + /* If this -EIO is due to a gpu hang, give the reset code a > + * chance to clean up the mess. Otherwise return the proper > + * SIGBUS. */ > + if (!atomic_read(&dev_priv->mm.wedged)) > + return VM_FAULT_SIGBUS; > case -EAGAIN: > /* Give the error handler a chance to run and move the > * objects off the GPU active list. Next time we service the > -- > 1.7.10 > -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48