From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/2] drm/i915: Don't drop pinned fences Date: Tue, 28 Jan 2014 14:40:28 +0200 Message-ID: <20140128124028.GX9454@intel.com> References: <1390855788-20422-1-git-send-email-daniel.vetter@ffwll.ch> <20140127212626.GE2508@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id E6A0FF9E83 for ; Tue, 28 Jan 2014 04:41:00 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Mon, Jan 27, 2014 at 10:41:57PM +0100, Daniel Vetter wrote: > On Mon, Jan 27, 2014 at 10:26 PM, Chris Wilson = wrote: > > On Mon, Jan 27, 2014 at 09:49:47PM +0100, Daniel Vetter wrote: > >> Userspace can currently provoke this when e.g. trying to use a pinned > >> scanout as a cursor or overlay target. Later on that might lead to > >> some fun fence pin count mayhem. > >> > >> Spurred by Ville's report that something goes wrong here and > >> originally I've thought that this might slip through the pwrite gtt > >> fastpath. But that one checks of obj tiling, so should be ok. > >> > >> But one thing that _does_ blow up is the vma unbinding with more than > >> one address space. The next patch will fix this. > > > > It's buggy behaviour, so if (WARN_ON(fence->pin_count) return -EBUSY; > > > > I did worry that we would then have some unexpected failure, a new EBUSY > > returning to userspace, but I think along the paths that can trigger it, > > we have already returned EBUSY in the (dim and distant) past. > = > Indeed we seem to have the required tiling checks everywhere. At first > I've had the WARN but then though userspace could sneak in through the > cursor/overlay code, but it can't. I'll update the patch. I've tested these (+ Chris's WARN_ON) and the issue looks to be fixed. Tested-by: Ville Syrj=E4l=E4 -- = Ville Syrj=E4l=E4 Intel OTC