Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2374613imm; Thu, 7 Jun 2018 09:33:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKD0My/ZehMj6bblHriEMvKNuq0wUG7iRnWOa+gOjUNEhIOuu8kN0YlpY06dcZT2/Z2Hi9G X-Received: by 2002:a65:4287:: with SMTP id j7-v6mr2202098pgp.144.1528389211049; Thu, 07 Jun 2018 09:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528389211; cv=none; d=google.com; s=arc-20160816; b=s4PMnC4y56/wvam22UN5vNaK4FQevJpg6IUXISNK9ynwlC64uYU9RZ3iQy/quZ1k0o UM14/tpHG+wnfCMrwpsZtWr4vrIdE7Jm3gwrqjvT9YILPnEuJCrYYXrSpQheBN/af+ZE juQ/8W7gbqyL2eoS93QGIP2Nz2IF79gt66HUX5em1pPBn3ZRSLg7Iu+ELvAOdqB3+0M3 EnuTcvdob3k6/GjiOJ8g2caKQ/6y1fYMtpPcn+dwu21L6lC1y5lwERnPdZn8TwmBzNIr ZCwpG6U21gT/GHMwm8j76R04nkJu4lfVGqysvtsSKkOXEMQl/OGJ02jWhG7+daFiQ2kd Mz8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=uUPfodA8bSAyzWjmG2+xbyrIeqrP7A6VCdBGQVkP73E=; b=wX2kTtje5Z59sw2tgMjl/bNinN2ERix94EM5lUVFetXz6yg98EHAqdzKLAkAHIRjzS iXdO6tLVSPlPBsv11DMVKohmSn00aKNRxbgjskP2sG5mp6pdQghkU06fKiuHRBdELfnB +ahZ4N3JZV4eXybvBW8faB9xTEw67zcYhyY5GdjDow0vdZFkBDC+eBthxAg2vGhKeBf3 QeIEGfJS5DNpEMxszQloVG26GH5f/mwJqSWGaVQvr26BFyZsnYAWD5vvWAsHfjBqt35b kWNuO6+SzZZJK0SjtspaG80DIyzkyrulfIBxoAYr5/MY7TW9Kt+3RqdFx41VhtlQt3n9 +IeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si9334827plt.115.2018.06.07.09.33.16; Thu, 07 Jun 2018 09:33:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932941AbeFGOLv (ORCPT + 99 others); Thu, 7 Jun 2018 10:11:51 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39555 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933168AbeFGOJk (ORCPT ); Thu, 7 Jun 2018 10:09:40 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbG-0005Zp-0P; Thu, 07 Jun 2018 15:09:14 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbC-0003Fp-W8; Thu, 07 Jun 2018 15:09:10 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Michel =?UTF-8?Q?D=C3=A4nzer?=" , "Alex Deucher" , "=?UTF-8?q?Christian=20K=C3=B6nig?=" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 361/410] drm/radeon: fix prime teardown order In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Christian König commit 0f4f715bc6bed3bf14c5cd7d5fe88d443e756b14 upstream. We unmapped imported DMA-bufs when the GEM handle was dropped, not when the hardware was done with the buffere. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/gpu/drm/radeon/radeon_gem.c | 2 -- drivers/gpu/drm/radeon/radeon_object.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -34,8 +34,6 @@ void radeon_gem_object_free(struct drm_g struct radeon_bo *robj = gem_to_radeon_bo(gobj); if (robj) { - if (robj->gem_base.import_attach) - drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg); radeon_bo_unref(&robj); } } --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -91,6 +91,8 @@ static void radeon_ttm_bo_destroy(struct mutex_unlock(&bo->rdev->gem.mutex); radeon_bo_clear_surface_reg(bo); radeon_bo_clear_va(bo); + if (bo->gem_base.import_attach) + drm_prime_gem_destroy(&bo->gem_base, bo->tbo.sg); drm_gem_object_release(&bo->gem_base); kfree(bo); }