From owner-freebsd-current@freebsd.org Tue Dec 13 17:07:49 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD420C75C25 for ; Tue, 13 Dec 2016 17:07:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 299D218F1 for ; Tue, 13 Dec 2016 17:07:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBDH7dam016331 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 13 Dec 2016 19:07:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBDH7dam016331 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBDH7d0r016330; Tue, 13 Dec 2016 19:07:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 13 Dec 2016 19:07:39 +0200 From: Konstantin Belousov To: Michael Butler Cc: FreeBSD Current Subject: Re: DRM_I915_GEM_OBJECT_MAX_PIN_COUNT failure on -current Message-ID: <20161213170739.GB54029@kib.kiev.ua> References: <57abe23a-d7b5-953c-9119-c1d281106db6@protected-networks.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57abe23a-d7b5-953c-9119-c1d281106db6@protected-networks.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 17:07:49 -0000 On Tue, Dec 13, 2016 at 11:49:37AM -0500, Michael Butler wrote: > I've been bitten by this twice on a KDE desktop in the last 24 hours .. > same error on both occasions :-( > > error: [drm:pid1197:i915_gem_object_pin] *ERROR* WARN ON: obj->pin_count > == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT > pid 1197 (Xorg), uid 0: exited on signal 6 (core dumped) > > [ .. ] > > error: [drm:pid16212:i915_gem_object_pin] *ERROR* WARN ON: > obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT > pid 16212 (Xorg), uid 0: exited on signal 6 (core dumped) > > I see only one change in the dev/drm2 sources (r309712) but there have > been many in the vm code. > > Any hints/pointers appreciated, This is indeed a bug in r309712, it seems. Please try this. diff --git a/sys/dev/drm2/i915/i915_gem.c b/sys/dev/drm2/i915/i915_gem.c index 2a53ae8f8ed..0fa5249e553 100644 --- a/sys/dev/drm2/i915/i915_gem.c +++ b/sys/dev/drm2/i915/i915_gem.c @@ -1521,7 +1521,7 @@ retry: /* Now bind it into the GTT if needed */ ret = i915_gem_object_pin(obj, 0, true, false); if (ret) - goto unpin; + goto unlock; pinned = 1; ret = i915_gem_object_set_to_gtt_domain(obj, write); @@ -1580,6 +1580,8 @@ have_page: return (VM_PAGER_OK); unpin: + i915_gem_object_unpin(obj); +unlock: DRM_UNLOCK(dev); out: KASSERT(ret != 0, ("i915_gem_pager_fault: wrong return"));