From patchwork Thu Mar 13 14:57:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3826201 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E0E29F375 for ; Thu, 13 Mar 2014 14:57:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F5D3201F4 for ; Thu, 13 Mar 2014 14:57:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0C91A201D5 for ; Thu, 13 Mar 2014 14:57:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F981FAECD; Thu, 13 Mar 2014 07:57:20 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by gabe.freedesktop.org (Postfix) with ESMTP id D0878FAECD for ; Thu, 13 Mar 2014 07:57:18 -0700 (PDT) Received: by mail-pb0-f48.google.com with SMTP id md12so1214449pbc.21 for ; Thu, 13 Mar 2014 07:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=3F72uSOg4lIAFh6vQIAWb32AkqWiNt+YfPBF9qQB//s=; b=ydYq1pZmo7xJ/J+LWtN4aiOZhnh1W5NNx2f1q1o2mJ/hWE6z2RhPW9B+ExWNnmZMWL rafBj/f/5h1vyC5M130XAlxqgVY+xObz0RLUCCY2bHN7tEQQ9AgvK/J8ukH8ptgONI0Z 9UF3kLe3GCZkgzfyk9NHpSiJTBNueqyi/sqkCmKg/GYkiRaszWPNKI6ptGsAOApa/gcP o6JFz8m2RHOmy1OWWLJIQyYscE1Xp65NkbXH1TlOcLjzG4ppq01VbCSABSTiWJTi5pzS NFrurqZoKr3TlY1bv+Wv174bL5sSAONgty5fwJLapUZx1ovo51Lsiuq6OBBcXNCPUpot WlFQ== X-Received: by 10.68.241.73 with SMTP id wg9mr3020879pbc.62.1394722638735; Thu, 13 Mar 2014 07:57:18 -0700 (PDT) Received: from localhost (jfdmzpr04-ext.jf.intel.com. [134.134.137.73]) by mx.google.com with ESMTPSA id bz4sm7778431pbb.12.2014.03.13.07.57.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Mar 2014 07:57:18 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Thu, 13 Mar 2014 11:57:13 -0300 Message-Id: <1394722633-24863-1-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.5.3 Subject: [Intel-gfx] [PATCH 4/4] drm/i915: dma_buf_vunmap is presumed not to fail, don't let it X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chris Wilson Since dma_buf_vunmap() procedes blithely on ignorant of whether the driver failed to actually unmap the backing storage for the dma-buf, we need to make a best-effort to do so. This involves not allowing ourselves to be susceptible to signals causing us to leak the storage. This should have been detectable with the current i-g-t as a misplaced signal should have left the pages pinned upon freeing the object where we have a warning in place. Signed-off-by: Chris Wilson Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c index 9bb533e..321102a 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c @@ -161,12 +161,8 @@ static void i915_gem_dmabuf_vunmap(struct dma_buf *dma_buf, void *vaddr) { struct drm_i915_gem_object *obj = dma_buf_to_obj(dma_buf); struct drm_device *dev = obj->base.dev; - int ret; - - ret = i915_mutex_lock_interruptible(dev); - if (ret) - return; + mutex_lock(&dev->struct_mutex); if (--obj->vmapping_count == 0) { vunmap(obj->dma_buf_vmapping); obj->dma_buf_vmapping = NULL;