From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 5/5] drm/i915: non-interruptible sleeps can't handle -EGAIN Date: Mon, 25 Jun 2012 22:35:49 +0200 Message-ID: <20120625203549.GF4708@phenom.ffwll.local> References: <1340548956-4097-1-git-send-email-daniel.vetter@ffwll.ch> <1340548956-4097-6-git-send-email-daniel.vetter@ffwll.ch> <1340655858_69625@CP5-2952> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C7059F081 for ; Mon, 25 Jun 2012 13:34:11 -0700 (PDT) Received: by wgbdr1 with SMTP id dr1so3465980wgb.12 for ; Mon, 25 Jun 2012 13:34:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1340655858_69625@CP5-2952> 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 Cc: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Mon, Jun 25, 2012 at 09:23:38PM +0100, Chris Wilson wrote: > On Sun, 24 Jun 2012 16:42:36 +0200, Daniel Vetter wrote: > > So don't return -EAGAIN, even in the case of a gpu hang. Remap it to -EIO > > instead. > > > > This is a bit ugly because intel_ring_begin is all non-interruptible > > and hence only returns -EIO. But as the comment in there says, > > auditing all the callsites would be a pain. > > > > To avoid duplicating code, reuse i915_gem_check_wedge in __wait_seqno. > > Use the opportunity to clarify the different cases a bit with > > comments. > > Two separate patches. The first chunk sounds reasonable, > non-interruptible is a little bit of misnomer here, we mostly use it to > mean NOFAIL, and none of the callers are setup to handle EAGAIN. So > reporting EIO seems reasonable. This started as a patch to avoid returning -EAGAIN from intel_ring_begin if mm.interruptible == false. After having added the same return -EIO logic at a few places, I've noticed that I might as well shove it into check_wedge and also call check_wedge from __wait_seqno (the older patch check the retvalues at a few places instead). Splitting this up would leave is in a state where we avoid returning -EAGAIN at a few places within the functions called by intel_ring_begin, but not all of them. Hence I think this should be all in one patch. -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48