From patchwork Fri Jan 30 05:38:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilija Hadzic X-Patchwork-Id: 5746661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1EAA99F358 for ; Fri, 30 Jan 2015 05:39:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 550B92024D for ; Fri, 30 Jan 2015 05:39:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4C7CA2024C for ; Fri, 30 Jan 2015 05:39:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC24D6E817; Thu, 29 Jan 2015 21:39:22 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 446DE6E818 for ; Thu, 29 Jan 2015 21:39:21 -0800 (PST) Received: by mail-qa0-f47.google.com with SMTP id n8so18659078qaq.6 for ; Thu, 29 Jan 2015 21:39:20 -0800 (PST) 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=1bxYBLk0yrWECMVzgYKs5tNMZXY6s5TfRngKr6I+FR4=; b=t2Bvo1B1L1saD0otHKe+UraxyCfhrz5UuadfeKUFSAcvh9TZp1ns6zMlO9R3wfCLL+ 0l2Ce1/P3MPfCOQkml3yutOyfqlrM9a9dJvll1OBklq6yeAPH0yEf5PlXS1lWHTNO3dV 54ivAd+GFQIROzEgXg5C4L7NOvcyQHt+3Kvy4R2QxKTe5eN46QC5R1GRbG7bZV1mc0TF iqeRS78uf1wf+f6iT3mjvYZVtrE2+v7Dus/1oBvh2pS0b+GDfnuUIYVrHl7Y5i+AY2xF 0VJeaqxb5FqoO7Xb9orDovaHGngyT1AYa6/yOyXYxe7VTe3rNFQeDdweSYCsWASsg4Bn pehQ== X-Received: by 10.140.34.177 with SMTP id l46mr8765639qgl.37.1422596360891; Thu, 29 Jan 2015 21:39:20 -0800 (PST) Received: from caterpillar.hsd1.nj.comcast.net. (c-98-221-34-209.hsd1.nj.comcast.net. [98.221.34.209]) by mx.google.com with ESMTPSA id q8sm9174976qam.1.2015.01.29.21.39.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 21:39:20 -0800 (PST) From: Ilija Hadzic X-Google-Original-From: Ilija Hadzic To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/radeon: fix the crash in test functions Date: Fri, 30 Jan 2015 00:38:44 -0500 Message-Id: <1422596324-1737-2-git-send-email-ihadzic@research.bell-labs.com> X-Mailer: git-send-email 2.2.0 In-Reply-To: <1422596324-1737-1-git-send-email-ihadzic@research.bell-labs.com> References: <1422596324-1737-1-git-send-email-ihadzic@research.bell-labs.com> Cc: Ilija Hadzic , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 radeon_copy_dma and radeon_copy_blit must be called with a valid reservation object. Otherwise a crash will be provoked. We borrow the object from vram BO. Cc: stable@vger.kernel.org Signed-off-by: Ilija Hadzic --- drivers/gpu/drm/radeon/radeon_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index 07b506b..79181816 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c @@ -119,11 +119,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) if (ring == R600_RING_TYPE_DMA_INDEX) fence = radeon_copy_dma(rdev, gtt_addr, vram_addr, size / RADEON_GPU_PAGE_SIZE, - NULL); + vram_obj->tbo.resv); else fence = radeon_copy_blit(rdev, gtt_addr, vram_addr, size / RADEON_GPU_PAGE_SIZE, - NULL); + vram_obj->tbo.resv); if (IS_ERR(fence)) { DRM_ERROR("Failed GTT->VRAM copy %d\n", i); r = PTR_ERR(fence); @@ -170,11 +170,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) if (ring == R600_RING_TYPE_DMA_INDEX) fence = radeon_copy_dma(rdev, vram_addr, gtt_addr, size / RADEON_GPU_PAGE_SIZE, - NULL); + vram_obj->tbo.resv); else fence = radeon_copy_blit(rdev, vram_addr, gtt_addr, size / RADEON_GPU_PAGE_SIZE, - NULL); + vram_obj->tbo.resv); if (IS_ERR(fence)) { DRM_ERROR("Failed VRAM->GTT copy %d\n", i); r = PTR_ERR(fence);