From patchwork Mon Mar 24 13:29:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3882731 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 CD58A9F334 for ; Mon, 24 Mar 2014 13:30:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE61720158 for ; Mon, 24 Mar 2014 13:29:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E16FF2013A for ; Mon, 24 Mar 2014 13:29:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A7206E9F9; Mon, 24 Mar 2014 06:29:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTP id ECF276E9F9 for ; Mon, 24 Mar 2014 06:29:56 -0700 (PDT) Received: by mail-pa0-f47.google.com with SMTP id lj1so5467288pab.20 for ; Mon, 24 Mar 2014 06:29:56 -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:in-reply-to:references; bh=3F72uSOg4lIAFh6vQIAWb32AkqWiNt+YfPBF9qQB//s=; b=KNHcXa4Q9pBg9us4JTFs3ksjxp6yGElXRs926E1qMi/FhtqpEtJhqSfPgIk6v2o5Dv TD+1UNuj1r+LynD1ABgV4tn1NyHp97JQxQNd7nHT6HFp0wWGp8d62GDxL1pf0Mu9335i YgglUjrQ5giSN2y4MJ2rV8Plac1PfZHsrpcxq0NH/3hJSuI2LvjZVRrFCEywTbS1UvPu pfXgVH9V/NN18Cb0MQ0V1U+HUQLI1VrjUd/VKseb1qRjB6tLx2UxVOSNFUKqew59QQLE wIebIzj1aL/iLC+UAnl0IcspaFdy+NSJ1eMqA/9MvfkkSbBrG9Jn9P0V229XXwA7TUkR Ccag== X-Received: by 10.66.243.70 with SMTP id ww6mr7218666pac.47.1395667796805; Mon, 24 Mar 2014 06:29:56 -0700 (PDT) Received: from localhost (jfdmzpr02-ext.jf.intel.com. [134.134.137.71]) by mx.google.com with ESMTPSA id vb7sm33299468pbc.13.2014.03.24.06.29.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 06:29:55 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 24 Mar 2014 10:29:39 -0300 Message-Id: <1395667780-2725-3-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1395667780-2725-1-git-send-email-rodrigo.vivi@gmail.com> References: <1395667780-2725-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 2/3] 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.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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;