From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gustavo Padovan Subject: Re: [PATCH] drm/msm: return fence_fd = -1 if gem_submit fails Date: Mon, 12 Dec 2016 19:23:25 -0200 Message-ID: <20161212212325.GD17192@joana> References: <1481571668-14094-1-git-send-email-gustavo@padovan.org> <20161212204213.GK20316@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from bhuna.collabora.co.uk ([46.235.227.227]:43969 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152AbcLLVXe (ORCPT ); Mon, 12 Dec 2016 16:23:34 -0500 Content-Disposition: inline In-Reply-To: <20161212204213.GK20316@nuc-i3427.alporthouse.com> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Chris Wilson , Gustavo Padovan , dri-devel@lists.freedesktop.org, Gustavo Padovan , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list , "open list:DRM DRIVER FOR MSM ADRENO GPU" 2016-12-12 Chris Wilson : > On Mon, Dec 12, 2016 at 05:41:08PM -0200, Gustavo Padovan wrote: > > From: Gustavo Padovan > > > > Previously we were returning garbage here, fix it by setting it to -1 > > before the first possible point of failure. > > The convention is that on error paths you do not modify user inputs. In > particular, consider EINTR where the usual pattern (e.g. drmIoctl) is > > do { > err = ioctl(fd, SUBMIT, arg); > } while (err == -EINTR); > > If you modify the in fence before you consume it, you can't recreate it > after handling the signal. Right. I didn't know about that convention. So maybe we let it as is. :) Gustavo