From patchwork Fri Dec 14 17:39:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1879951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 0FE0E40079 for ; Fri, 14 Dec 2012 17:43:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7F5CE6886 for ; Fri, 14 Dec 2012 09:42:59 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BFF1E5CC7 for ; Fri, 14 Dec 2012 09:42:48 -0800 (PST) Received: by mail-vb0-f49.google.com with SMTP id r6so4403678vbi.36 for ; Fri, 14 Dec 2012 09:42:47 -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:x-mailer; bh=xgcE5dn4v1vZjBG4xfv8vMW6dFnav4fBi7ujcGB+asQ=; b=QGyvWI5t2XHFLd9T7OVNVeM6hR1PpiXfVYwsajtNS2zj3Wf5xQsVaz+JwclL1pXPlv Elc12ZWIon8WIU1rsaBIrVylhwXhbN/+tGiSqFaY1G55lkGf8/7xpAPw+3smBAcQ1n0C VDzxp42Q2gxcayZks7TT7FKKvkAATHVWZCmxZ7doGB4ihHuCiWGKc7y/aTzEwZb9pXRI H+gWLAt/8Gfg2GBFbw/cH1iFLuTo781F3Q3skxpBCM3y2ONGL4VxqoXcM5e5pIBNEWxi i3XgeuatTRYVlU01sEqMYV7c+dw37Ufd6mKiFmHONQ2N8fo9A+uPeW4fJxHrhmTqJkCt n39w== Received: by 10.52.88.168 with SMTP id bh8mr8863397vdb.51.1355506967803; Fri, 14 Dec 2012 09:42:47 -0800 (PST) Received: from localhost.boston.devel.redhat.com ([66.187.233.206]) by mx.google.com with ESMTPS id ey7sm3871872ved.0.2012.12.14.09.42.45 (version=SSLv3 cipher=OTHER); Fri, 14 Dec 2012 09:42:46 -0800 (PST) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: resume fence driver to last sync sequence on lockup Date: Fri, 14 Dec 2012 12:39:36 -0500 Message-Id: <1355506776-3213-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.11.7 Cc: Jerome Glisse X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Jerome Glisse After lockup we need to resume fence to last sync sequence and not last received sequence so that all thread waiting on command stream that lockedup resume. Otherwise GPU reset will be ineffective in most cases. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 22bd6c2..38233e7 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -787,7 +787,7 @@ int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring) } rdev->fence_drv[ring].cpu_addr = &rdev->wb.wb[index/4]; rdev->fence_drv[ring].gpu_addr = rdev->wb.gpu_addr + index; - radeon_fence_write(rdev, atomic64_read(&rdev->fence_drv[ring].last_seq), ring); + radeon_fence_write(rdev, rdev->fence_drv[ring].sync_seq[ring], ring); rdev->fence_drv[ring].initialized = true; dev_info(rdev->dev, "fence driver on ring %d use gpu addr 0x%016llx and cpu addr 0x%p\n", ring, rdev->fence_drv[ring].gpu_addr, rdev->fence_drv[ring].cpu_addr);