From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: The timeout for wait_timeout_ioctl is only valid upon success Date: Tue, 9 Apr 2013 11:07:40 +0200 Message-ID: <20130409090740.GT2228@phenom.ffwll.local> References: <1365497895-16272-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) by gabe.freedesktop.org (Postfix) with ESMTP id A0AF5E5CC0 for ; Tue, 9 Apr 2013 02:04:41 -0700 (PDT) Received: by mail-ea0-f174.google.com with SMTP id m14so2770803eaj.33 for ; Tue, 09 Apr 2013 02:04:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1365497895-16272-1-git-send-email-chris@chris-wilson.co.uk> 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: intel-gfx@lists.freedesktop.org, Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org On Tue, Apr 09, 2013 at 09:58:15AM +0100, Chris Wilson wrote: > As we only update and sanitize the return timeout value after a > successful wait, we should not assert that it is valid for any error > returns. Also, for consistency, we should only modify args->timeout_ns > upon success. Doesn't that break our -EAGAIN trickery? -Daniel > = > Cc: Ville Syrj=E4l=E4 > Cc: Ben Widawsky > Signed-off-by: Chris Wilson > --- > drivers/gpu/drm/i915/i915_gem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_= gem.c > index 63c05dd..da78cf7 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -2377,7 +2377,7 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *d= ata, struct drm_file *file) > mutex_unlock(&dev->struct_mutex); > = > ret =3D __wait_seqno(ring, seqno, reset_counter, true, timeout); > - if (timeout) { > + if (ret =3D=3D 0 && timeout) { > WARN_ON(!timespec_valid(timeout)); > args->timeout_ns =3D timespec_to_ns(timeout); > } > -- = > 1.7.10.4 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch