From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: Unpin last_context at reset Date: Thu, 19 Jun 2014 08:47:22 +0100 Message-ID: <20140619074722.GC10572@nuc-i3427.alporthouse.com> References: <1403118289-19550-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id B20586E824 for ; Thu, 19 Jun 2014 00:47:27 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1403118289-19550-1-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 18, 2014 at 10:04:48PM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > We're forgetting to unpin the last_context from the ggtt at GPU reset > time. This leads to the vma pin_count leaking at every reset if the > last context wasn't the ring default context. Further use of the same > context will trigger the pin_count check in i915_gem_object_pin() and > userspace will be faced with EBUSY as a result. > = > This plaques kms_flip rather badly since it performs lots of resets, > and every fd has its own default context these days. > = > Fix the problem by properly unpinning the last context at reset. Ah, the context reset here is faked because we never restore the default context state. Hmm, in fact, I get the impression that we should just delete i915_gem_context_reset(), and make i915_gem_context_enable() function correctly after the GPU is reset. -Chris -- = Chris Wilson, Intel Open Source Technology Centre