From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Disable all GEM timers and work on unload Date: Wed, 16 Oct 2013 19:41:26 +0200 Message-ID: <20131016174126.GM4830@phenom.ffwll.local> References: <1381482868-13602-1-git-send-email-chris@chris-wilson.co.uk> <1381920601-1092-1-git-send-email-chris@chris-wilson.co.uk> <20131016115027.GJ4830@phenom.ffwll.local> <20131016164726.GA32493@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 51C74E6B65 for ; Wed, 16 Oct 2013 10:41:07 -0700 (PDT) Received: by mail-ee0-f48.google.com with SMTP id l10so532022eei.35 for ; Wed, 16 Oct 2013 10:41:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131016164726.GA32493@nuc-i3427.alporthouse.com> 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 , Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Oct 16, 2013 at 05:47:26PM +0100, Chris Wilson wrote: > On Wed, Oct 16, 2013 at 01:50:29PM +0200, Daniel Vetter wrote: > > On Wed, Oct 16, 2013 at 11:50:01AM +0100, Chris Wilson wrote: > > > We have two once very similar functions, i915_gpu_idle() and > > > i915_gem_idle(). The former is used as the lower level operation to > > > flush work on the GPU, whereas the latter is the high level interface to > > > flush the GEM bookkeeping in addition to flushing the GPU. As such > > > i915_gem_idle() also clears out the request and activity lists and > > > cancels the delayed work. This is what we need for unloading the driver, > > > unfortunately we called i915_gpu_idle() instead. > > > > > > In the process, make sure that when cancelling the delayed work and > > > timer, which is synchronous, that we do not hold any locks to prevent a > > > deadlock if the work item is already waiting upon the mutex. This > > > requires us to push the mutex down from the caller to i915_gem_idle(). > > > > > > v2: s/i915_gem_idle/i915_gem_suspend/ > > > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70334 > > > Signed-off-by: Chris Wilson > > > Tested-by: xunx.fang@intel.com > > > > Queued for -next, thanks for the patch. > > Oops, spotted a bug in my v2. > ums.mm_suspend should only be set for !kms. Sorry that slipped my mind > when doing the s/_idle/_suspend. Actually I've noticed since it was missing from the changelog, but figured you've decided against that. I'll rectify it. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch