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 13:50:29 +0200 Message-ID: <20131016115027.GJ4830@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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by gabe.freedesktop.org (Postfix) with ESMTP id F3847E6140 for ; Wed, 16 Oct 2013 04:50:09 -0700 (PDT) Received: by mail-ea0-f179.google.com with SMTP id b10so298012eae.38 for ; Wed, 16 Oct 2013 04:50:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1381920601-1092-1-git-send-email-chris@chris-wilson.co.uk> 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 Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch